Custom Android Yolov5

I am trying to use my trained yolov5 model with the android app example here:
Android Object Detection Example

I figured i have to modify the values inside

PrePostProcessor.java

so i updated them according to my model

    // model input image size
    static int mInputWidth = 640;
    static int mInputHeight = 640;

    // model output is of size 25200*11
    private static int mOutputRow = 25200; // as decided by the YOLOv5 model for input image of size 640*640
    private static int mOutputColumn = 11; // left, top, right, bottom, score and 6 class probability
    private static float mThreshold = 0.50f; // score above which a detection is generated
    private static int mNmsLimit = 15;
    ........................................................
    Result result = new Result(cls, outputs[i*11+4], rect);

This is how my input and output look like
inputonx
My result view always places all predictions in the corner of the image (I cant upload multiple pictures)

Is there anyting else i should change?

cc @IvanKobzarev could you help take a look? Thanks!

The changes look good… Can you upload your model here so I can give it a try? Thanks.

Sure, thank you.
Model

Also, i did get it to work using tflite and this repo:
Tflite YOLOv5 Android

With your model and the same changes you made (but the original classes.txt file), I got “airplane 0.34” for the 1st test image, no results for the 2nd one, and “car 0.70” for the 3rd one. Are these the same as what you see? If not can you please upload your test result on the 1st image? I haven’t been able to see what other changes need to be made yet…