3、PyTorch訓練YOLOv11—部署篇(detect)—Windows系統

夕西行發表於2024-10-09

1、pt轉onnx或engine

from ultralytics import YOLO

model = YOLO("best.pt")
model.export(format="onnx")
# model.export(format="engine")

# 預測看下效果
onnx_model = YOLO("best.onnx", task="detect")
results = onnx_model("https://ultralytics.com/images/bus.jpg")
results[0].show()

'''
tensorrt_model = YOLO("best.engine", task="detect")
results = tensorrt_model("https://ultralytics.com/images/bus.jpg")
results[0].show()
'''

2、部署框架的選擇

onnxruntime、paddlepaddle等

、、、、未完待續!

相關文章