AI/TLDR

Ultralytics YOLO

Train and run YOLO models for real-time detection, segmentation, and tracking

Overview

Ultralytics YOLO is a Python framework for training and running YOLO models on common computer vision tasks. It covers object detection, tracking, instance and semantic segmentation, image classification, and pose estimation behind one consistent API.

It is aimed at developers and researchers who want to fine-tune a vision model on their own data or run a pretrained model on images and video. You work with it either from the command line using the yolo command or directly in Python with the YOLO class.

Within the computer vision category, it sits at the model-training and inference layer: you load a pretrained checkpoint, train or validate it on a dataset, run predictions, and export the result to formats like ONNX for deployment.

What it does

  • One API across detection, tracking, segmentation, classification, and pose estimation tasks
  • Command-line yolo tool and a Python YOLO class for the same workflows
  • Train, validate, predict, and export modes built in
  • Ships with pretrained checkpoints you can fine-tune on your own datasets
  • Export trained models to formats such as ONNX for deployment
  • Runs on Python 3.8+ with PyTorch 1.8+

Getting started

Install the package into a Python 3.8+ environment with PyTorch 1.8+, then run a prediction from the CLI or train and export a model in Python.

Install the package

Install ultralytics and its requirements with pip.

bashbash
pip install ultralytics

Run a prediction from the CLI

Use the yolo command to predict on an image with a pretrained model.

bashbash
yolo predict model=yolo26n.pt source='https://ultralytics.com/images/bus.jpg'

Train, evaluate, and export in Python

Load a pretrained model, train it on a dataset, run inference, and export to ONNX.

pythonpython
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",
    epochs=100,
    imgsz=640,
    device="cpu",
)

# Evaluate the model's performance on the validation set
metrics = model.val()

# Perform object detection on an image
results = model("path/to/image.jpg")
results[0].show()

# Export the model to ONNX format for deployment
path = model.export(format="onnx")

Commands and code are distilled from the project's own documentation — always check the official repo for the latest.

When to use it

  • Detecting and counting objects in images or video streams in real time
  • Fine-tuning a pretrained detector on a custom labeled dataset
  • Adding object tracking across frames in a video pipeline
  • Exporting a trained model to ONNX to deploy it outside Python

How Ultralytics YOLO compares

Ultralytics YOLO alongside other open-source vision & understanding tools AI/TLDR tracks, ranked by GitHub stars.

ToolStarsWhat it does
PaddleOCR★ 83.1kA toolkit for detecting and recognizing text in images across many languages, plus document parsing.
Ultralytics YOLO★ 58.6kTrain and run YOLO models for real-time detection, segmentation, and tracking
Supervision★ 44.7kA Python toolkit for processing, annotating, and visualizing detections and segmentations from many vision models.
MMDetection★ 32.8kAn OpenMMLab toolbox with many object detection and instance segmentation algorithms for research and production.
Segment Anything 2 (SAM 2)★ 19.4kMeta's model for segmenting and tracking any object across images and video frames from clicks or boxes.
Grounded-SAM★ 17.6kA pipeline that combines Grounding DINO and Segment Anything to detect and segment objects from text prompts.
DINOv3★ 10.7kMeta's self-supervised vision backbone that produces general-purpose image features for many downstream tasks.
Segment Anything 3 (SAM 3)★ 10.6kMeta's segmentation model that detects, segments, and tracks objects in images and video from text or visual prompts.