c++下的onnx推理
参考代码:https://github.com/itsnine/yolov5-onnxruntime
参考链接:https://blog.csdn.net/magic_ll/article/details/125517798
1.下载onnx
官网:https://github.com/microsoft/onnxruntime/releases/tag/v1.21.0
2.下载代码
https://github.com/itsnine/yolov5-onnxruntime
3.修改cmakelist
4.编译
在cmakelists.txt的同文件夹下
mkdir build
cd build
cmake ..
cmake --build .
5.ONNX和opencv的dll放到对应的Debug目录下
如果不设置,会被默认链接到C:\Windows\System32下的onnxruntime.dll导致版本报错
6.运行,在build/debug下
yolo_ort.exe --model_path=../../models/yolov5s.onnx --image=../../images/bus.jpg --class_names=../../models/coco.names