android-demo-app
android-demo-app copied to clipboard
object_detection demo the argsort is wrong
hi, the comparator in [nonMaxSuppression] function of pytorch/demo/objectdetection)/PrePostProcessor.java is asc order, not desc order. it is just oppositive than swift comparator. the right one in java is :
// Do an argsort on the confidence scores, from high to low.
Collections.sort(boxes,
new Comparator<Result>() {
@Override
public int compare(Result o1, Result o2) {
return o2.score.compareTo(o1.score);
}
});
Hi, that seems to be the case! We were experiencing much lower confidence scores in the mobile app with respect to GPU. This fix apparently did the trick.