Closed lujiazho closed 3 years ago
@leaving-voider can you show results on the same image? There's really no point in showing model A on image 1 vs model B on image 2.
@leaving-voider can you show results on the same image? There's really no point in showing model A on image 1 vs model B on image 2.
thanks for reply, actually they are the same model. And the model deployed on Android cannot have any meanful detection, no matter what image I put it on/(ㄒoㄒ)/
@leaving-voider Hi, I faced the same essue. And I solved.
If you used tf.py for convert .pt to .tflite, You just need to modify all source code from numClasss+5 to numClass.
Example, float[][][] out = new float[1][output_box][numClass + 5]; to float[][][] out = new float[1][output_box][numClass];
Because, You have already calculated it when you convert tflite.
Good luck!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
@jeenhyung Thanks for pointing out the problem. I forgot to subtract 5 (xywh and confidence of bounding boxes) from the last dimension of the output-tensor shape.
This problem is fixed by changing: https://github.com/zldrobit/yolov5/commit/021345e4d4ed5484c9ed7525b4c447e8f40c0129#diff-a26b4f7400b6abfb58aa58de11ddb26a87e70312b2df009ca7d9043d405dfeb2L134-R134 in the new tf-android branch.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
❔Question
does anybody why would this problem come out? when I detect the image with the int8 tflite model by detect.py, it looks like this image
it can detect every wheat head correctly without any wrong box
But when I deploy the same model file on Android, it looks like this all the time, how could that be ? image
does anybody have the same problem?
Additional context
I used the way of zldrobit, and the link is https://github.com/zldrobit/yolov5/tree/tf-android