yolo-export
Use when exporting or deploying Ultralytics YOLO models in Platform or code — the Platform Export tab and yolo export/model.export() for ONNX, TensorRT, CoreML, Core AI, OpenVINO, LiteRT, NCNN, ExecuTorch, and NPUs (RKNN, QNN, Hailo, Ascend, IMX, Axelera, DeepX, Xilinx), FP16/INT8 quantization, benchmarking, and non-Python runtimes. For inference with .pt weights or Platform endpoints, see yolo-inference.
ultralytics · 已有静态检查记录
安装与使用
运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。
npx skills add ultralytics/skills --skill yolo-export技能说明
name: yolo-export description: > Use when exporting or deploying Ultralytics YOLO models in Platform or code — the Platform Export tab and yolo export/model.export() for ONNX, TensorRT, CoreML, Core AI, OpenVINO, LiteRT, NCNN, ExecuTorch, and NPUs (RKNN, QNN, Hailo, Ascend, IMX, Axelera, DeepX, Xilinx), FP16/INT8 quantization, benchmarking, and non-Python runtimes. For inference with .pt weights or Platform endpoints, see yolo-inference.
Export, quantization & deployment
Fastest route: export in Platform
Open a completed model's Export tab, select a format, configure its arguments, and click Start Export. Platform runs CPU exports directly and asks for a target GPU where the format requires one (notably TensorRT); download the artifact when the job completes. For TensorRT, select the deployment device's GPU family or Jetson target; if its TensorRT/CUDA versions differ from the device's, export locally on that device instead.
Use Platform when you do not want to install each exporter toolchain locally. Use the Python/CLI path below for custom calibration, repeatable automation, local hardware builds, or immediate parity validation. See Platform model export.
Quickstart
from ultralytics import YOLO
model = YOLO("runs/detect/train/weights/best.pt")
path = model.export(format="onnx") # returns the exported file/dir path
yolo export model=best.pt format=onnx
Exports load straight back into YOLO() for predict/val — same API:
model = YOLO("best.onnx") # or best.engine, best_openvino_model/, ...
Choose format by target hardware
| Target | format= | Why |
|---|---|---|
| NVIDIA GPU / Jetson | engine (TensorRT) | fastest on NVIDIA; build on the deployment device — engines are not portable across GPUs/TRT versions |
| Intel CPU/iGPU/NPU | openvino | up to 3× CPU speedup on Intel |
| Apple iOS/macOS | coreml | broad OS coverage, Vision/iOS/Flutter support |
| Apple iOS 27+/macOS 27+ | coreai | native .aimodel; iOS/Flutter SDKs default to coreml; export on Apple silicon macOS 26+ or x86_64 Linux |
| Android | litert (renamed from tflite) or ncnn | NCNN strong on ARM |
| Raspberry Pi | ncnn | best ARM CPU latency |
| PyTorch Edge | executorch | |
| Cross-platform / unsure | onnx | runs everywhere; start here, specialize when latency demands |
| NPUs (Rockchip/Qualcomm/Hailo/Huawei/Sony/Axelera/DeepX/AMD) | rknn / qnn / hailo / ascend / imx / axelera / deepx / xilinx | name= selects the exact chip for rknn/qnn/hailo/ascend/xilinx |
Full 22-target local export matrix with per-format supported args: format-matrix.md (this folder).
Key arguments
| Arg | Default | Notes |
|---|---|---|
imgsz | model | inherited from the loaded model; set explicitly to the deployment shape |
quantize | None | precision request: 16/fp16, 8/int8/w8a8, w8a16, w8a32, or 32/fp32; support, speed, size, and accuracy are backend-dependent — see format-matrix.md and benchmark the target |
data | None | representative calibration data when required; use >300 images generally and 500+ for TensorRT. Omission selects a small task default, so pass deployment-representative data explicitly |
dynamic | False | variable input shape/batch where supported; check format-matrix.md and benchmark the target |
batch | 1 | max batch baked into the export |