convert yolov5 model to ONNX and run on c++ interface

Viewed 5497

I have yolo model as yolov5s.yaml and i have saved my weights file as best.pt . Now want to convert yolo model to ONNX and run on c++ interface . I have gone through this https://github.com/ultralytics/yolov5/issues/251 but not able to do .Any help or useful resources will be helpful . Thanks

2 Answers

I tried run the examples provided in the first link successfully, the statements are: git clone github.com/ultralytics/yolov5 # clone repo cd yolov5 pip install -r requirements.txt # base requirements pip install coremltools>=4.1 onnx>=1.9.0 scikit-learn==0.19.2 # export requirements python models/export.py --weights yolov5s.pt --img 640 --batch 1 # export at 640x640 with batch size 1

It shows the export was successfully. The weight file in above example is yolov5s.pt. What kind of errors did you get by running these statements with your best.pt file?

Related