yolo系列训练出来的模型为.pt格式文件
1.pt转onnx
通过export.py文件将pt文件转为onnx文件
export.py文件使用yolov5项目中提供的文件即可
文件下载地址:
https://github.com/Shaoyc/FeatureRecognition/tree/master/References
转换命令:
python export.py --simplify --opset 12 --include onnx --batch-size 1 --imgsz 640 --weights yolov5.pt
2.onnx转IR
通过mo.py文件将onnx文件转为xml,bin,mapping三个文件
mo.py文件使用openvino项目中提供的文件即可
文件下载地址:
https://github.com/Shaoyc/FeatureRecognition/tree/master/References
转换命令:
python mo.py --input_model ./yolov5.onnx --output_dir ./ --input_shape [1,3,640,640] --scale 255