WongKinYiu / yolov7

Implementation of paper - YOLOv7: Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors
GNU General Public License v3.0
13.24k stars 4.18k forks source link

Export Yolov7 model to TF Lite for Android Deploy #1894

Open lnhutnam opened 11 months ago

lnhutnam commented 11 months ago

Hi all,

I am new in application deploy with TF Lite. I found that, input for Yolov5 is [1, 320, 320,3] and in the case of Yolov7 is [1,3,640,640] And the output of Yolov5 [1, 6300, 85], yolov7 is [1, 1]

I have read the blog post https://medium.com/geekculture/journey-putting-yolo-v7-model-into-tensorflow-lite-object-detection-api-model-running-on-android-e3f746a02fc4

But I have no idea in config the dimension for exporting to TF Lite and use it for android

Anyone has ideas for solving it? Please help me.

Thank you so much

dsbyprateekg commented 10 months ago

@lnhutnam You need to first convert your yolov7 weight to onnx format as mentioned in below link- https://colab.research.google.com/github/WongKinYiu/yolov7/blob/main/tools/YOLOv7onnx.ipynb

After that you need to convert onnx to tflite format. You can follow below link for complete process- https://mpolinowski.github.io/docs/IoT-and-Machine-Learning/ML/2023-01-14-yolov7_to_tensorflow/2023-01-14/