Deploy ultralytics Yolov5 pretained model with C++ language ;
- GCC 7.5
- Opencv 4.5.4
-
go to yolov5 release page download yolov5 pretrained model(official onnx can't work right),such as yolv5s.pt
-
use
export.py
convert yolov5s.pt to yolov5.onnx:git clone https://github.com/ultralytics/yolov5.git cd yolov5 python3.7 export.py --data data/coco128.yaml --weights yolov5s.pt --include onnx
git clone https://github.com/Hexmagic/ONNX_yolov5.git
mkdir build&&cd build
cmake ..
make -j4
cd ..
./build/main yolov5s.onnx data/images/zidane.jpg