跳至正文
OpenAgentSkill
浏览已开放 · 目录记录日期 2026-11-21 · 自动更新和账户服务暂时关闭。
开发与测试

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

Targetformat=Why
NVIDIA GPU / Jetsonengine (TensorRT)fastest on NVIDIA; build on the deployment device — engines are not portable across GPUs/TRT versions
Intel CPU/iGPU/NPUopenvinoup to 3× CPU speedup on Intel
Apple iOS/macOScoremlbroad OS coverage, Vision/iOS/Flutter support
Apple iOS 27+/macOS 27+coreainative .aimodel; iOS/Flutter SDKs default to coreml; export on Apple silicon macOS 26+ or x86_64 Linux
Androidlitert (renamed from tflite) or ncnnNCNN strong on ARM
Raspberry Pincnnbest ARM CPU latency
PyTorch Edgeexecutorch
Cross-platform / unsureonnxruns everywhere; start here, specialize when latency demands
NPUs (Rockchip/Qualcomm/Hailo/Huawei/Sony/Axelera/DeepX/AMD)rknn / qnn / hailo / ascend / imx / axelera / deepx / xilinxname= 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

ArgDefaultNotes
imgszmodelinherited from the loaded model; set explicitly to the deployment shape
quantizeNoneprecision 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
dataNonerepresentative calibration data when required; use >300 images generally and 500+ for TensorRT. Omission selects a small task default, so pass deployment-representative data explicitly
dynamicFalsevariable input shape/batch where supported; check format-matrix.md and benchmark the target
batch1max batch baked into the export
阅读完整来源 ↗