Build Real-Time Computer Vision with YOLOv8

YOLOv8 is Ultralytics' anchor-free YOLO family for object detection, segmentation, classification and pose estimation. Install it, test a pretrained model in minutes, then fine-tune and export it for production.

  • Detect · Segment · Pose
  • 5 sizes: n to x
  • Python 3.8+ · PyTorch 1.8+
  • AGPL-3.0 or Enterprise
Urban intersection with detection boxes around a car, a cyclist and a pedestrian
Illustration of a camera image progressing through feature extraction

What Is YOLOv8?

YOLOv8 is a single-stage computer vision model family that Ultralytics released on January 10, 2023. "YOLO" stands for You Only Look Once: the network looks at an image one time and predicts every object in it at once, which is why it runs fast enough for live video.

It is distributed through the ultralytics Python package, which gives you a yolo command-line tool and a Python YOLO class. The same interface trains, validates, predicts, tracks and exports models, whether you work on detection, segmentation, classification or pose.

Under the hood, YOLOv8 swapped earlier anchor boxes for an anchor-free, decoupled head and refreshed its backbone and neck. Ultralytics now points new projects to its YOLO26 models, but YOLOv8 is still available in the same package and remains a popular, well-documented choice.

Read the architecture guide
First release
Jan 10, 2023
Model scales
5 n · s · m · l · x
Core tasks
4 + tracking
License options
2 AGPL-3.0 · Enterprise

Everything YOLOv8 Can Do

Six capabilities built into the same package and the same short commands.

Object detection

Find and label every object in an image or video frame with a bounding box, class name and confidence score, using models pretrained on the 80-class COCO dataset.

yolov8n.pt

Instance segmentation

Go beyond boxes and outline the exact pixels of each object, useful for measuring areas, cutting out objects or precise robotics.

yolov8n-seg.pt

Image classification

Assign a single label to a whole image with lightweight classifiers pretrained on ImageNet, ideal for sorting and filtering pictures.

yolov8n-cls.pt

Pose estimation

Locate human body keypoints such as shoulders, elbows and knees to analyse posture, movement and gestures in real time.

yolov8n-pose.pt

Multi-object tracking

Follow detected objects across video frames with persistent IDs using the built-in BoT-SORT or ByteTrack trackers.

mode=track

Export for deployment

Convert trained models to ONNX, TensorRT, OpenVINO, CoreML, TensorFlow Lite and more with one command or one Python call.

format=onnx

From Install to Deployment in Four Steps

The typical YOLOv8 workflow, whether you only need predictions or a fully custom model.

  1. Install the package

    Set up a virtual environment and install ultralytics with pip, or install the source ZIP from the Download section.

    pip install ultralytics
    1
  2. Load a pretrained model

    Pick a checkpoint that fits your hardware. Weights download automatically the first time you use them.

    YOLO("yolov8n.pt")
    2
  3. Predict or train

    Run predictions on images, folders, video or a webcam, or fine-tune on your own labeled dataset.

    model.train(data=…)
    3
  4. Export and deploy

    Export the best weights to the format your app needs and run it on a server, desktop or edge device.

    model.export(format=…)
    4
quickstart.py
from ultralytics import YOLO

model = YOLO("yolov8n.pt")                 # load a pretrained model
results = model("street.jpg")              # predict on an image
model.train(data="data.yaml", epochs=100)  # fine-tune on your data
model.export(format="onnx")                # export for deployment

System Requirements and Supported Platforms

YOLOv8 is a Python package, so requirements follow Python and PyTorch rather than a single operating system.

Required

Python 3.8 or newer

Declared minimum in the package setup. Use a virtual environment per project.

Required

PyTorch 1.8 or newer

Install the build for your OS and GPU from pytorch.org before ultralytics.

Supported

Windows, macOS, Linux

Runs wherever Python and a supported PyTorch build install.

Recommended

NVIDIA GPU with CUDA

Strongly recommended for training and for the fastest inference.

Works

CPU-only machines

Prediction works; training is possible but much slower.

Supported

Apple silicon Macs

Use PyTorch's MPS backend with device="mps" for acceleration.

Optional

Docker

Ultralytics publishes the ultralytics/ultralytics image for containers.

Optional

Notebooks and cloud

Colab, Kaggle and Jupyter notebooks run the same Python API.

Exact speed and memory use depend on your hardware, model size and image size. No minimum RAM is officially fixed; larger models and batch sizes simply need more memory.

Where YOLOv8 Is Typically Used

Common applications for a fast, trainable vision model. Most of them start from pretrained weights and a small custom dataset.

Traffic and smart-city analytics

Count vehicles, cyclists and pedestrians, measure queue lengths and study how intersections are used.

Retail and inventory

Spot empty shelf space, count products and understand store traffic from existing camera feeds.

Manufacturing inspection

Detect scratches, missing parts or misaligned components on a production line after training on your own defects.

Agriculture and aerial imagery

Locate crops, weeds, livestock or structures in drone and satellite images with a custom-trained detector.

Workplace safety

Check for helmets, vests and restricted-zone entry, always within local privacy and labour rules.

Sports and fitness

Use pose models to follow athletes, count repetitions and review technique frame by frame.

Why Developers Choose YOLOv8

The value is less about a single benchmark and more about how quickly you can go from an idea to a working model, then to an app that runs it.

Download Now
  • One API for five tasks

    Detection, segmentation, classification, pose and tracking share the same commands, so skills transfer between projects.

  • Pretrained starting points

    COCO and ImageNet weights let you fine-tune with far fewer labeled images than training from scratch.

  • Sizes for every budget

    Five scales let you trade speed for accuracy without rewriting code, from small devices to large GPUs.

  • Fast to experiment

    A full training run, validation and prediction can be launched with one short command each.

  • Deployment-friendly

    Built-in export removes most of the glue code between a trained model and a production runtime.

  • Large community

    Extensive documentation, tutorials and community answers make problems easier to solve.

Compare the Five YOLOv8 Detection Models

Official detection figures for the COCO val2017 dataset at 640 px, as published in the Ultralytics documentation.

YOLOv8 detection model comparison
ModelmAPval 50-95CPU ONNX speed (ms)A100 TensorRT speed (ms)Params (M)FLOPs (B)
YOLOv8n37.380.40.993.28.7
YOLOv8s44.9128.41.2011.228.6
YOLOv8m50.2234.71.8325.978.9
YOLOv8l52.9375.22.3943.7165.1
YOLOv8x53.9479.13.5368.2257.8

Speeds were measured by Ultralytics on their reference hardware; your results will differ. Segmentation, classification and pose models have their own tables in the official docs.

How to Install YOLOv8

Choose the route that fits you. Most people use the pip package; the ZIP route installs the exact snapshot offered on this page.

  1. 1

    Create a virtual environment

    Keep YOLOv8 separate from other Python projects.

    python -m venv yolo-env
  2. 2

    Install PyTorch for your hardware

    Pick the CPU, CUDA or ROCm build on pytorch.org and install it first.

    pip install torch torchvision
  3. 3

    Install ultralytics

    This installs the yolo command and the Python API with YOLOv8 support.

    pip install -U ultralytics
  4. 4

    Verify the setup

    Prints Python, PyTorch, CUDA and package details so you can confirm everything is found.

    yolo checks

The ZIP's setup.py uses the older pkg_resources module. If a very recent setuptools release refuses it, install an older setuptools inside the virtual environment or use the pip package route instead.

Download YOLOv8

Get the YOLOv8 source archive from GitHub as a single ZIP file. It contains the ultralytics package source, Docker files, requirements and the AGPL-3.0 license, ready to install with pip on Windows, macOS or Linux.

File
YOLOv8-main.zip
Type
Python source code
Package version
ultralytics 8.0.169
License
AGPL-3.0
Download YOLOv8
Illustrated source archive package with a cyan download arrow

Download and Usage Safety Notes

Practical habits that keep your machine, your data and your trained models in good shape.

Know what you downloaded

The ZIP is plain Python source. Read README.md and LICENSE, and expect no .exe installer inside.

Use a virtual environment

Isolated environments keep YOLOv8's dependencies from changing other Python projects on your machine.

Keep data on your terms

Inference runs locally on your hardware. Handle camera footage and personal images according to privacy law.

Back up trained weights

Copy best.pt from the runs folder after training so a reinstall or cleanup never loses your work.

Update deliberately

Pin package versions in production and test new ultralytics releases before upgrading a working pipeline.

YOLOv8 Strengths and Limitations

A balanced look before you commit a project to it.

Pros

  • One package covers detection, segmentation, classification, pose and tracking
  • Pretrained weights in five sizes for fast fine-tuning
  • Short, consistent CLI and Python API
  • Broad export support for servers, desktops and edge devices
  • Mature documentation and a large user community

Cons

  • AGPL-3.0 requires open-sourcing your project or buying an Enterprise License
  • No formal research paper to cite
  • Ultralytics recommends newer YOLO26 models for new projects
  • Training the larger sizes needs a capable GPU
  • The ZIP snapshot (8.0.169) is older than current package releases

Verdict: YOLOv8 remains an excellent way to learn modern object detection and to power open-source or properly licensed products. Check the license early, and compare it with newer Ultralytics models when starting from scratch.

Common YOLOv8 Problems and Fixes

Quick answers to the issues people hit most often during setup and training.

Module not found

If Python reports that ultralytics is missing, activate the right virtual environment and reinstall the package inside it.

GPU not being used

Check torch.cuda.is_available(). If it returns False, install a CUDA-enabled PyTorch build that matches your driver.

libGL errors on servers

Headless Linux machines lack desktop libraries. Use the headless OpenCV build or install the missing system library.

Out of memory while training

Lower batch size or image size, or switch to a smaller model such as YOLOv8s or YOLOv8n.

Weights fail to download

Download the .pt file on another connection, place it in your project folder and point model= to that path.

Export errors

Install the target's extra package, such as onnx or TensorRT, and keep PyTorch and runtime versions compatible.

YOLOv8 Questions, Answered

Twenty short answers about downloading, installing, licensing, training and deploying YOLOv8.

YOLOv8 is a family of real-time computer vision models released by Ultralytics on January 10, 2023. It handles object detection, instance segmentation, image classification and pose estimation, and later Ultralytics releases added oriented bounding boxes. It ships inside the ultralytics Python package with a yolo command-line tool and a Python API.