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等
、、、、未完待續!