ultralytics/export.py
2025-02-25 11:58:34 +08:00

11 lines
332 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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