ncnnforandroid_objectiondetection_Mobilenetssd icon indicating copy to clipboard operation
ncnnforandroid_objectiondetection_Mobilenetssd copied to clipboard

length of result: 0 不知是哪里出了问题

Open yangdonghan50 opened this issue 5 years ago • 2 comments

2019-10-26 15:38:54.538 31152-31152/che.example.com D/che.example.com.MainActivity: origin predict result:[] 2019-10-26 15:38:54.538 31152-31152/che.example.com D/result length: length of result: 0 2019-10-26 15:38:54.539 31152-31152/che.example.com W/System.err: java.lang.ArrayIndexOutOfBoundsException: length=0; index=1 2019-10-26 15:38:54.539 31152-31152/che.example.com W/System.err: at che.example.com.MainActivity.get_max_result(MainActivity.java:199) 2019-10-26 15:38:54.539 31152-31152/che.example.com W/System.err: at che.example.com.MainActivity.predict_image(MainActivity.java:177) 2019-10-26 15:38:54.539 31152-31152/che.example.com W/System.err: at che.example.com.MainActivity.onActivityResult(MainActivity.java:152) 2019-10-26 15:38:54.539 31152-31152/che.example.com W/System.err: at android.app.Activity.dispatchActivityResult(Activity.java:7365) 2019-10-26 15:38:54.539 31152-31152/che.example.com W/System.err: at android.app.ActivityThread.deliverResults(ActivityThread.java:4329) 2019-10-26 15:38:54.539 31152-31152/che.example.com W/System.err: at android.app.ActivityThread.handleSendResult(ActivityThread.java:4377) 2019-10-26 15:38:54.539 31152-31152/che.example.com W/System.err: at android.app.ActivityThread.-wrap19(Unknown Source:0) 2019-10-26 15:38:54.539 31152-31152/che.example.com W/System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1671) 2019-10-26 15:38:54.539 31152-31152/che.example.com W/System.err: at android.os.Handler.dispatchMessage(Handler.java:106) 2019-10-26 15:38:54.539 31152-31152/che.example.com W/System.err: at android.os.Looper.loop(Looper.java:164) 2019-10-26 15:38:54.539 31152-31152/che.example.com W/System.err: at android.app.ActivityThread.main(ActivityThread.java:6650) 2019-10-26 15:38:54.539 31152-31152/che.example.com W/System.err: at java.lang.reflect.Method.invoke(Native Method) 2019-10-26 15:38:54.540 31152-31152/che.example.com W/System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547) 2019-10-26 15:38:54.540 31152-31152/che.example.com W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:818)

yangdonghan50 avatar Oct 26 '19 07:10 yangdonghan50

读取图片后 没有结果输出

yangdonghan50 avatar Oct 26 '19 07:10 yangdonghan50

今天遇到同样的问题,发现原因调用接口之前,bitmap图片转换有问题. Bitmap rgba = imageData.copy(Bitmap.Config.ARGB_8888, true); // resize Bitmap input_bmp = Bitmap.createScaledBitmap(rgba, ddims[2], ddims[3], false); 在此之前不要对图片进行任何的压缩处理.

jinzhuliu avatar Feb 20 '20 17:02 jinzhuliu