pytorch / android-demo-app

PyTorch android examples of usage in applications
1.48k stars 607 forks source link

the bugs in objectDetection order to low scores #328

Open RoAdv opened 1 year ago

RoAdv commented 1 year ago

Hello, when we run the demo of ObjectDetection, the detection effect is inconsistent with the effect on the PC. After reading the code, we found that there are two bugs. I would like to discuss with you:

  1. In PrePostProcessor#nonMaxSuppression, the description of sort algorithm is from high to low, but in fact it is from low to hign, which will lead to prioritize get results with low scores.
  2. In ObjectDetectionActivity#analyzeImage, the line matrix.postRotate(90.0f), Why should it be rotated 90 degrees? If the original image is not rotated by 90 degrees during training, but process it during detection, it will lead to incorrect detection and extremely low scores.