1.安装yolov8
# Install the required package for YOLOv8 pip install ultralytics
2.模型转换
from ultralytics import YOLO # Load the YOLOv8 model model = YOLO("yolov8n.pt") # Export the model to ONNX format model.export(format="onnx") # creates 'yolov8n.onnx' # Load the exported ONNX model onnx_model = YOLO("yolov8n.onnx") # Run inference result = onnx_model.predict(source='1.png', save=True) print(result)
参考: https://blog.csdn.net/qq_29402011/article/details/140937125
标签:ultralytics,onnx,模型,YOLO,yolov8,yolov8n,model From: https://www.cnblogs.com/cqwo/p/18420935