See below for quickstart installation and usage examples. For comprehensive guidance on training, validation, prediction, and deployment, refer to our full Ultralytics Docs.
For alternative installation methods, including Conda, Docker, and building from source via Git, please consult the Quickstart Guide.
Usage
CLI
You can use Ultralytics YOLO directly from the Command Line Interface (CLI) with the yolo command:
# Predict using a pretrained YOLO model (e.g., YOLO26n) on an image
yolo predict model=yolo26n.pt source='https://ultralytics.com/images/bus.jpg'
The yolo command supports various tasks and modes, accepting additional arguments like imgsz=640. Explore the YOLO CLI Docs for more examples.
Python
Ultralytics YOLO can also be integrated directly into your Python projects. It accepts the same configuration arguments as the CLI:
from ultralytics import YOLO
# Load a pretrained YOLO26n model
model = YOLO("yolo26n.pt")
# Train the model on the COCO8 dataset for 100 epochs
train_results = model.train(
data="coco8.yaml", # Path to dataset configuration file
epochs=100, # Number of training epochs
imgsz=640, # Image size for training
device="cpu", # Device to run on (e.g., 'cpu', 0, [0,1,2,3])
)
# Evaluate the model's performance on the validation set
metrics = model.val()
# Perform object detection on an image
results = model("path/to/image.jpg") # Predict on an image
results[0].show() # Display results
# Export the model to ONNX format for deployment
path = model.export(format="onnx") # Returns the path to the exported model
mAPval values refer to single-model single-scale performance on the COCO val2017 dataset. See YOLO Performance Metrics for details. Reproduce with yolo detect val data=coco.yaml device=0. Add nms=False to reproduce the e2e column.
Speed metrics are averaged over COCO val images with ONNX on CPU and TensorRT10 on an NVIDIA T4 GPU.
Segmentation (COCO)
Refer to the Segmentation Docs for usage examples. These models are trained on COCO-Seg, including 80 classes.
mAPval values are for single-model single-scale on the COCO val2017 dataset. See YOLO Performance Metrics for details. Reproduce with yolo segment val data=coco.yaml device=0 nms=False
Speed metrics are averaged over COCO val images with ONNX on CPU and TensorRT10 on an NVIDIA T4 GPU.
mIoUval values are for single-model single-scale on the Cityscapes validation set. Reproduce with yolo semantic val data=cityscapes.yaml device=0 imgsz=2048
Speed metrics are averaged over Cityscapes validation images using an RTX3090 instance. Reproduce with yolo semantic val data=cityscapes.yaml batch=1 device=0|cpu imgsz=2048
Depth Estimation (NYU Depth V2)
See the Depth Estimation Docs for usage examples. These models are pretrained on a broad multi-dataset mix and evaluated on the NYU Depth V2 Eigen test split, predicting per-pixel depth in meters.
δNYU1 is the fraction of pixels where the predicted depth is within a factor of 1.25 of the ground truth, on the NYU Depth V2 Eigen test split (654 images) with multi-scale + horizontal-flip TTA and log-least-squares alignment.
Single-scale accuracy without TTA is reproducible with yolo depth val model=yolo26n-depth.pt data=nyu-depth.yaml imgsz=768 device=0 (substitute model= for each size), which uses median (scale-only) alignment and scores lower: δ1 0.783 (n), 0.793 (s), 0.840 (m), 0.853 (l), 0.860 (x).
abs_rel is the mean absolute relative error between predicted and ground-truth depth values.
rmse is the root mean squared error in meters.
Speed is inference-only latency (pre/post-processing excluded) at imgsz=768, batch=1, reported as mean ± std over timed runs after warmup. CPU ONNX is ONNX Runtime fp32 on a 32-core Intel Xeon (Skylake); T4 TensorRT10 is TensorRT fp16 on a Tesla T4.
params and FLOPs are measured at 768×768, the training resolution of the released weights.
Classification (ImageNet)
Consult the Classification Docs for usage examples. These models are trained on ImageNet, covering 1000 classes.
mAPval values are for single-model single-scale on the COCO Keypoints val2017 dataset. See YOLO Performance Metrics for details. Reproduce with yolo pose val data=coco-pose.yaml device=0 nms=False
Speed metrics are averaged over COCO val images with ONNX on CPU and TensorRT10 on an NVIDIA T4 GPU.
Oriented Bounding Boxes (DOTAv1)
Check the OBB Docs for usage examples. These models are trained on DOTAv1, including 15 classes.
mAPtest values are for single-model multiscale performance on the DOTAv1 test set. Reproduce by yolo obb val data=DOTAv1.yaml device=0 split=test nms=False save_json=True and submit merged results to the DOTA evaluation server.
Our key integrations with leading AI platforms extend the functionality of Ultralytics' offerings, enhancing tasks like dataset labeling, training, visualization, and model management. Discover how Ultralytics, in collaboration with partners like Weights & Biases, Comet ML, Roboflow, and Intel OpenVINO, can optimize your AI workflow. Explore more at Ultralytics Integrations.
🤝 Contribute
We thrive on community collaboration! Ultralytics YOLO wouldn't be the SOTA framework it is without contributions from developers like you. Please see our Contributing Guide to get started. We also welcome your feedback—share your experience by completing our Survey. A huge Thank You 🙏 to everyone who contributes!
We look forward to your contributions to help make the Ultralytics ecosystem even better!
📜 License
Ultralytics offers two licensing options to suit different needs:
AGPL-3.0 License: This OSI-approved open-source license is perfect for students, researchers, and enthusiasts. It encourages open collaboration and knowledge sharing. See the LICENSE file for full details.
Ultralytics Enterprise License: For development and production use, this license enables seamless integration of Ultralytics software and AI models into business products and services, including internal tools, automated workflows, and production deployments, bypassing the open-source requirements of AGPL-3.0. To get started, please contact us via Ultralytics Licensing.
📞 Contact
For bug reports and feature requests related to Ultralytics software, please visit GitHub Issues. For questions, discussions, and community support, join our active communities on Discord, Reddit, and the Ultralytics Community Forums. We're here to help with all things Ultralytics!
Alternatives
Use instead of ultralytics: tools that do the same job, closest first.