A simple CLI utility to download Ultralytics YOLO models (v5, v8, v11) and export them to ONNX format.
- Auto-download: Fetches
.ptmodels usage theultralyticslibrary. - Custom Resolution: Choose between 640, 960, and 1280 input sizes.
- Auto-class Export: Generates a
_classes.txtfile identifying all object classes (ID: Name). - Minimal Dependencies: Only requires
ultralyticsandonnx.
-
Install generic requirements (script will attempt auto-install):
pip install -r requirements.txt
-
Run the script:
python export_model.py
-
Follow the interactive prompts:
- Select YOLO Version (v5, v8, v11)
- Select Model Size (Nano to Extra Large)
- Select Resolution
The script generates two files:
<model>.onnx: The generic ONNX model ready for inference.<model>_info.txt: A text file containing model metadata and class list.