Instructions to use Ultralytics/YOLOv8 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- ultralytics
How to use Ultralytics/YOLOv8 with ultralytics:
from ultralytics import YOLOvv8 model = YOLOvv8.from_pretrained("Ultralytics/YOLOv8") source = 'http://images.cocodataset.org/val2017/000000039769.jpg' model.predict(source=source, save=True) - YOLOv10
How to use Ultralytics/YOLOv8 with YOLOv10:
from ultralytics import YOLOvv8 model = YOLOvv8.from_pretrained("Ultralytics/YOLOv8") source = 'http://images.cocodataset.org/val2017/000000039769.jpg' model.predict(source=source, save=True) - Notebooks
- Google Colab
- Kaggle
δΈζ | νκ΅μ΄ | ζ₯ζ¬θͺ | Π ΡΡΡΠΊΠΈΠΉ | Deutsch | FranΓ§ais | EspaΓ±ol | PortuguΓͺs | TΓΌrkΓ§e | TiαΊΏng Viα»t | Ψ§ΩΨΉΨ±Ψ¨ΩΨ©
Ultralytics creates cutting-edge, state-of-the-art (SOTA) YOLO models built on years of foundational research in computer vision and AI. Constantly updated for performance and flexibility, our models are fast, accurate, and easy to use. They excel at object detection, tracking, instance segmentation, semantic segmentation, image classification, and pose estimation tasks.
Find detailed documentation in the Ultralytics Docs. Get support via GitHub Issues. Join discussions on Discord, Reddit, and the Ultralytics Community Forums!
Request an Enterprise License for commercial use at Ultralytics Licensing.
π Documentation
See below for quickstart installation and usage examples. For comprehensive guidance on training, validation, prediction, and deployment, refer to our full Ultralytics Docs.
Install
Install the ultralytics package, including all requirements, in a Python>=3.8 environment with PyTorch>=1.8.
pip install ultralytics
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., YOLOv8n) on an image
yolo predict model=yolov8n.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 YOLOv8n model
model = YOLO("yolov8n.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
Discover more examples in the YOLO Python Docs.
β¨ Models
Ultralytics supports a wide range of YOLO models, from early versions like YOLOv3 to the latest YOLO26. The tables below showcase YOLOv8 models pretrained on COCO for Detection, Segmentation, and Pose Estimation. Classification models are pretrained on ImageNet. Tracking mode is compatible with Detection, Segmentation, and Pose models. All Models download automatically from the latest Ultralytics release on first use.
Detection (COCO)
See Detection Docs for usage examples with these models trained on COCO, which include 80 pre-trained classes.
| Model | size (pixels) |
mAPval 50-95 |
Speed CPU ONNX (ms) |
Speed A100 TensorRT (ms) |
params (M) |
FLOPs (B) |
|---|---|---|---|---|---|---|
| YOLOv8n | 640 | 37.3 | 80.4 | 0.99 | 3.2 | 8.7 |
| YOLOv8s | 640 | 44.9 | 128.4 | 1.20 | 11.2 | 28.6 |
| YOLOv8m | 640 | 50.2 | 234.7 | 1.83 | 25.9 | 78.9 |
| YOLOv8l | 640 | 52.9 | 375.2 | 2.39 | 43.7 | 165.2 |
| YOLOv8x | 640 | 53.9 | 479.1 | 3.53 | 68.2 | 257.8 |
- mAPval values are for single-model single-scale on COCO val2017 dataset.
Reproduce byyolo val detect data=coco.yaml device=0 - Speed averaged over COCO val images using an Amazon EC2 P4d instance.
Reproduce byyolo val detect data=coco.yaml batch=1 device=0|cpu
Segmentation (COCO)
See Segmentation Docs for usage examples with these models trained on COCO-Seg, which include 80 pre-trained classes.
| Model | size (pixels) |
mAPbox 50-95 |
mAPmask 50-95 |
Speed CPU ONNX (ms) |
Speed A100 TensorRT (ms) |
params (M) |
FLOPs (B) |
|---|---|---|---|---|---|---|---|
| YOLOv8n-seg | 640 | 36.7 | 30.5 | 96.1 | 1.21 | 3.4 | 12.6 |
| YOLOv8s-seg | 640 | 44.6 | 36.8 | 155.7 | 1.47 | 11.8 | 42.6 |
| YOLOv8m-seg | 640 | 49.9 | 40.8 | 317.0 | 2.18 | 27.3 | 110.2 |
| YOLOv8l-seg | 640 | 52.3 | 42.6 | 572.4 | 2.79 | 46.0 | 220.5 |
| YOLOv8x-seg | 640 | 53.4 | 43.4 | 712.1 | 4.02 | 71.8 | 344.1 |
- mAPval values are for single-model single-scale on COCO val2017 dataset.
Reproduce byyolo val segment data=coco-seg.yaml device=0 - Speed averaged over COCO val images using an Amazon EC2 P4d instance.
Reproduce byyolo val segment data=coco-seg.yaml batch=1 device=0|cpu
Classification (ImageNet)
See Classification Docs for usage examples with these models trained on ImageNet, which include 1000 pretrained classes.
| Model | size (pixels) |
acc top1 |
acc top5 |
Speed CPU ONNX (ms) |
Speed A100 TensorRT (ms) |
params (M) |
FLOPs (B) at 224 |
|---|---|---|---|---|---|---|---|
| YOLOv8n-cls | 224 | 69.0 | 88.3 | 12.9 | 0.31 | 2.7 | 4.3 |
| YOLOv8s-cls | 224 | 73.8 | 91.7 | 23.4 | 0.35 | 6.4 | 13.5 |
| YOLOv8m-cls | 224 | 76.8 | 93.5 | 85.4 | 0.62 | 17.0 | 42.7 |
| YOLOv8l-cls | 224 | 78.3 | 94.2 | 163.0 | 0.87 | 37.5 | 99.7 |
| YOLOv8x-cls | 224 | 79.0 | 94.6 | 232.0 | 1.01 | 57.4 | 154.8 |
- acc values are model accuracies on the ImageNet dataset validation set.
Reproduce byyolo val classify data=path/to/ImageNet device=0 - Speed averaged over ImageNet val images using an Amazon EC2 P4d instance.
Reproduce byyolo val classify data=path/to/ImageNet batch=1 device=0|cpu
Pose (COCO)
See Pose Docs for usage examples with these models trained on COCO-Pose, which include 1 pre-trained class, person.
| Model | size (pixels) |
mAPpose 50-95 |
mAPpose 50 |
Speed CPU ONNX (ms) |
Speed A100 TensorRT (ms) |
params (M) |
FLOPs (B) |
|---|---|---|---|---|---|---|---|
| YOLOv8n-pose | 640 | 50.4 | 80.1 | 131.8 | 1.18 | 3.3 | 9.2 |
| YOLOv8s-pose | 640 | 60.0 | 86.2 | 233.2 | 1.42 | 11.6 | 30.2 |
| YOLOv8m-pose | 640 | 65.0 | 88.8 | 456.3 | 2.00 | 26.4 | 81.0 |
| YOLOv8l-pose | 640 | 67.6 | 90.0 | 784.5 | 2.59 | 44.4 | 168.6 |
| YOLOv8x-pose | 640 | 69.2 | 90.2 | 1607.1 | 3.73 | 69.4 | 263.2 |
| YOLOv8x-pose-p6 | 1280 | 71.6 | 91.2 | 4088.7 | 10.04 | 99.1 | 1066.4 |
- mAPval values are for single-model single-scale on COCO Keypoints val2017 dataset.
Reproduce byyolo val pose data=coco-pose.yaml device=0 - Speed averaged over COCO val images using an Amazon EC2 P4d instance.
Reproduce byyolo val pose data=coco-pose.yaml batch=1 device=0|cpu
OBB (DOTAv1)
See OBB Docs for usage examples with these models trained on DOTAv1, which include 15 pre-trained classes.
| Model | size (pixels) |
mAPtest 50 |
Speed CPU ONNX (ms) |
Speed A100 TensorRT (ms) |
params (M) |
FLOPs (B) |
|---|---|---|---|---|---|---|
| YOLOv8n-obb | 1024 | 78.0 | 204.77 | 3.57 | 3.1 | 23.3 |
| YOLOv8s-obb | 1024 | 79.5 | 424.88 | 4.07 | 11.4 | 76.3 |
| YOLOv8m-obb | 1024 | 80.5 | 763.48 | 7.61 | 26.4 | 208.6 |
| YOLOv8l-obb | 1024 | 80.7 | 1278.42 | 11.83 | 44.5 | 433.8 |
| YOLOv8x-obb | 1024 | 81.36 | 1759.10 | 13.23 | 69.5 | 676.7 |
- mAPtest values are for single-model multiscale on DOTAv1 dataset.
Reproduce byyolo val obb data=DOTAv1.yaml device=0 split=testand submit merged results to DOTA evaluation. - Speed averaged over DOTAv1 val images using an Amazon EC2 P4d instance.
Reproduce byyolo val obb data=DOTAv1.yaml batch=1 device=0|cpu
π§© Integrations
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!
- Downloads last month
- 9,541

