export.py 332 B

1234567891011
  1. import warnings
  2. warnings.filterwarnings('ignore')
  3. from ultralytics import YOLO
  4. # onnx onnxsim onnxruntime onnxruntime-gpu
  5. # 导出参数官方详解链接:https://docs.ultralytics.com/modes/export/#usage-examples
  6. if __name__ == '__main__':
  7. model = YOLO('yolov8n.pt')
  8. model.export(format='onnx', simplify=True, opset=13)