← 返回命令列表

Linux command

yolo 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Run object detection

yolo detect predict model=[yolo11n.pt] source=[image.jpg]

Train a model

yolo detect train data=[data.yaml] model=[yolo11n.pt] epochs=[100] imgsz=[640]

Validate model

yolo detect val model=[best.pt] data=[data.yaml]

Export model

yolo export model=[best.pt] format=[onnx]

Track objects

yolo detect track model=[yolo11n.pt] source=[video.mp4]

Run pose estimation

yolo pose predict model=[yolo11n-pose.pt] source=[image.jpg]

Benchmark

yolo benchmark model=[yolo11n.pt] imgsz=[640]

说明

yolo is the CLI for Ultralytics YOLO, a state-of-the-art computer vision framework. It provides commands for object detection, instance segmentation, image classification, pose estimation, and oriented bounding box detection from the terminal. The tool supports a complete workflow: train builds models from datasets, val evaluates model accuracy, predict runs inference on images or video, export converts models to deployment formats like ONNX and TensorRT, track performs multi-object tracking on video streams, and benchmark tests model performance across formats. Each command accepts an optional task type (detect, segment, classify, pose, obb) and a required mode. Arguments are passed as key=value pairs. Pre-trained models can be used directly for inference or fine-tuned on custom datasets. GPU acceleration is supported through PyTorch.

参数

detect
Object detection.
segment
Instance segmentation.
classify
Image classification.
pose
Pose estimation.
obb
Oriented bounding box detection.
train
Train a model on a dataset.
val
Validate model accuracy.
predict
Run inference on images, video, or streams.
export
Convert model to deployment formats (ONNX, TensorRT, CoreML, etc.).
track
Multi-object tracking on video.
benchmark
Benchmark model speed and accuracy across export formats.
model=_path_
Model file path (e.g., yolo11n.pt).
data=_path_
Dataset configuration YAML file.
source=_path_
Input source: image, video, directory, URL, or webcam (0).
epochs=_n_
Number of training epochs.
imgsz=_size_
Input image size (default: 640).
batch=_n_
Batch size.
device=_id_
Device: GPU id (0, 0,1) or cpu.
format=_fmt_
Export format: onnx, engine, coreml, tflite, etc.
conf=_threshold_
Confidence threshold for predictions.

FAQ

What is the yolo command used for?

yolo is the CLI for Ultralytics YOLO, a state-of-the-art computer vision framework. It provides commands for object detection, instance segmentation, image classification, pose estimation, and oriented bounding box detection from the terminal. The tool supports a complete workflow: train builds models from datasets, val evaluates model accuracy, predict runs inference on images or video, export converts models to deployment formats like ONNX and TensorRT, track performs multi-object tracking on video streams, and benchmark tests model performance across formats. Each command accepts an optional task type (detect, segment, classify, pose, obb) and a required mode. Arguments are passed as key=value pairs. Pre-trained models can be used directly for inference or fine-tuned on custom datasets. GPU acceleration is supported through PyTorch.

How do I run a basic yolo example?

Run `yolo detect predict model=[yolo11n.pt] source=[image.jpg]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does detect do in yolo?

Object detection.