Yolov8 TFLite Model on Android

Hello everyone , I’m trying to run yolov8 model on android. This is the Yolov5Classifier.java file. It works for yolov5 model.Where do I need to change in Yolov5Classifier.java file for yolov8 ? Which parts should I pay attention to ?
I added the YOLOV5Classifier.java file here.
https://github.com/usertttwm/YoloV5Android/blob/main/YOLOV5Classifier.java
Thanks.

@Laura1

1.Check the create method where the model is initialized. Ensure that you are using the correct filepath for the YOLOv8 model GraphDef protocol buffer (modelFilename).

2.Confirm that the input size parameter (inputSize) matches the expected input size for the YOLOv8 model. YOLO models often have specific input size requirements.

  1. Examine how the output of the YOLOv5 model is processed in the code. The YOLOv8 model might have differences in terms of the number of bounding box predictions, classes, or other output details.

  2. If YOLOv8 uses a different set of anchors or masks, you might need to update the corresponding variables in the code.

I’d recommend referring to documentation for further details: Home - Ultralytics YOLO Docs

Hi @BadarJaffer . Thank you very much for reply. Yolov5 model input shape (1, 3, 416, 416) output shape (1, 10647, 11)
Yolov8 model input shape (1, 3, 416, 416) and output shape(s) (1, 6, 3549)

/final int[] output_width,
final int[][] masks,
final int[] anchors
/) These values ​​are not used. But yolov5 works

1 Like