Image Classification — ONNX Export
ONNX is a portable, hardware-agnostic format for edge deployment. Export is done directly from the Training Monitor tab — no separate Export page is needed.
Why ONNX
| Benefit | Description |
|---|---|
| Portability | Runs on any platform with an ONNX runtime — Linux, Windows, ARM, embedded Linux |
| Performance | Highly optimised inference speed and low memory use |
| No Python required | Loadable by C++, Java, JavaScript, and others |
Converting best.pt to ONNX
- Go to the Training Monitor tab
- In the ".pt to ONNX" panel, click "Convert best.pt → ONNX"
- The tool locates
best.ptautomatically inruns_yolo/train/weights/ - When conversion succeeds,
best.onnxis saved alongsidebest.pt
Output location: <project>/runs_yolo/train/weights/best.onnx
| Detail | Value |
|---|---|
| Export method | Ultralytics built-in ONNX export |
| ONNX opset | Version 11 — broadly compatible |
| Input shape | Dynamic batch size; fixed image width/height from training Image Size |
| Output | Detection tensor with class scores, bounding boxes, and confidence values |
IMPORTANT
ONNX export requires onnx and onnxruntime packages — installed automatically with the Image (YOLO) environment. If export fails, verify both packages are present.
Deployment Targets
| Target Platform | Recommended Runtime |
|---|---|
| Edge device (Linux, ARM) | pip install onnxruntime or onnxruntime-gpu |
| Web / JavaScript | ONNX Runtime Web (ort-web) for browser-based inference |
TIP
Compare best.pt vs best.onnx inference results to confirm export preserved accuracy. mAP scores should be identical or within 0.1%.