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.ptYOLOv8 is Ultralytics' anchor-free YOLO family for object detection, segmentation, classification and pose estimation.


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 guideSix capabilities built into the same package and the same short commands.
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.ptGo beyond boxes and outline the exact pixels of each object, useful for measuring areas, cutting out objects or precise robotics.
yolov8n-seg.ptAssign a single label to a whole image with lightweight classifiers pretrained on ImageNet, ideal for sorting and filtering pictures.
yolov8n-cls.ptLocate human body keypoints such as shoulders, elbows and knees to analyse posture, movement and gestures in real time.
yolov8n-pose.ptFollow detected objects across video frames with persistent IDs using the built-in BoT-SORT or ByteTrack trackers.
mode=trackConvert trained models to ONNX, TensorRT, OpenVINO, CoreML, TensorFlow Lite and more with one command or one Python call.
format=onnxThe typical YOLOv8 workflow, whether you only need predictions or a fully custom model.
Set up a virtual environment and install ultralytics with pip, or install the source ZIP from the Download section.
pip install ultralyticsPick a checkpoint that fits your hardware. Weights download automatically the first time you use them.
YOLO("yolov8n.pt")Run predictions on images, folders, video or a webcam, or fine-tune on your own labeled dataset.
model.train(data=…)Export the best weights to the format your app needs and run it on a server, desktop or edge device.
model.export(format=…)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
YOLOv8 is a Python package, so requirements follow Python and PyTorch rather than a single operating system.
Declared minimum in the package setup. Use a virtual environment per project.
Install the build for your OS and GPU from pytorch.org before ultralytics.
Runs wherever Python and a supported PyTorch build install.
Strongly recommended for training and for the fastest inference.
Prediction works; training is possible but much slower.
Use PyTorch's MPS backend with device="mps" for acceleration.
Ultralytics publishes the ultralytics/ultralytics image for containers.
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.
Common applications for a fast, trainable vision model. Most of them start from pretrained weights and a small custom dataset.
Count vehicles, cyclists and pedestrians, measure queue lengths and study how intersections are used.
Spot empty shelf space, count products and understand store traffic from existing camera feeds.
Detect scratches, missing parts or misaligned components on a production line after training on your own defects.
Locate crops, weeds, livestock or structures in drone and satellite images with a custom-trained detector.
Check for helmets, vests and restricted-zone entry, always within local privacy and labour rules.
Use pose models to follow athletes, count repetitions and review technique frame by frame.
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 NowDetection, segmentation, classification, pose and tracking share the same commands, so skills transfer between projects.
COCO and ImageNet weights let you fine-tune with far fewer labeled images than training from scratch.
Five scales let you trade speed for accuracy without rewriting code, from small devices to large GPUs.
A full training run, validation and prediction can be launched with one short command each.
Built-in export removes most of the glue code between a trained model and a production runtime.
Extensive documentation, tutorials and community answers make problems easier to solve.
Official detection figures for the COCO val2017 dataset at 640 px, as published in the Ultralytics documentation.
| Model | mAPval 50-95 | CPU ONNX speed (ms) | A100 TensorRT speed (ms) | Params (M) | FLOPs (B) |
|---|---|---|---|---|---|
| YOLOv8n | 37.3 | 80.4 | 0.99 | 3.2 | 8.7 |
| YOLOv8s | 44.9 | 128.4 | 1.20 | 11.2 | 28.6 |
| YOLOv8m | 50.2 | 234.7 | 1.83 | 25.9 | 78.9 |
| YOLOv8l | 52.9 | 375.2 | 2.39 | 43.7 | 165.1 |
| YOLOv8x | 53.9 | 479.1 | 3.53 | 68.2 | 257.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.
Choose the route that fits you. Most people use the pip package; the ZIP route installs the exact snapshot offered on this page.
Keep YOLOv8 separate from other Python projects.
python -m venv yolo-envPick the CPU, CUDA or ROCm build on pytorch.org and install it first.
pip install torch torchvisionThis installs the yolo command and the Python API with YOLOv8 support.
pip install -U ultralyticsPrints Python, PyTorch, CUDA and package details so you can confirm everything is found.
yolo checksUnzip YOLOv8-main.zip into a working folder such as Documents/YOLOv8-main.
YOLOv8-main/Activate your virtual environment, then move into the extracted folder.
cd YOLOv8-mainInstalls the bundled ultralytics 8.0.169 source so code edits apply immediately.
pip install -e .The yolov8n.pt weights download automatically on first use.
yolo predict model=yolov8n.pt source=img.jpgThe image includes PyTorch, ultralytics and their dependencies.
docker pull ultralytics/ultralytics:latestGive the container GPU access on Linux with the NVIDIA Container Toolkit.
docker run -it --ipc=host ultralytics/ultralytics:latestDownload a detection checkpoint from the Ultralytics/YOLOv8 repository.
hf_hub_download("Ultralytics/YOLOv8", "yolov8n.pt")Pass the downloaded path to the YOLO class and call it on an image.
YOLO(path)("img.jpg")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.
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.
Download YOLOv8
Practical habits that keep your machine, your data and your trained models in good shape.
The ZIP is plain Python source. Read README.md and LICENSE, and expect no .exe installer inside.
Isolated environments keep YOLOv8's dependencies from changing other Python projects on your machine.
Inference runs locally on your hardware. Handle camera footage and personal images according to privacy law.
Copy best.pt from the runs folder after training so a reinstall or cleanup never loses your work.
Pin package versions in production and test new ultralytics releases before upgrading a working pipeline.
A balanced look before you commit a project to it.
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.
Quick answers to the issues people hit most often during setup and training.
If Python reports that ultralytics is missing, activate the right virtual environment and reinstall the package inside it.
Check torch.cuda.is_available(). If it returns False, install a CUDA-enabled PyTorch build that matches your driver.
Headless Linux machines lack desktop libraries. Use the headless OpenCV build or install the missing system library.
Lower batch size or image size, or switch to a smaller model such as YOLOv8s or YOLOv8n.
Download the .pt file on another connection, place it in your project folder and point model= to that path.
Install the target's extra package, such as onnx or TensorRT, and keep PyTorch and runtime versions compatible.
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.
The code and pretrained weights are free under the AGPL-3.0 open-source license, which suits research, learning and fully open-source projects. If you want to ship YOLOv8 inside a closed-source or commercial product without publishing your code, Ultralytics asks you to buy an Enterprise License, and it does not publish prices for it.
The main button downloads YOLOv8-main.zip, a source-code archive of a GitHub repository's main branch. It holds the ultralytics package source (it reports version 8.0.169), Docker files, requirements.txt, setup.py, the README and the AGPL-3.0 license. It is source code, not a Windows installer.
The simplest route is a Python virtual environment followed by pip install ultralytics. If you downloaded the ZIP, extract it, open a terminal in the folder and run pip install -e . to install that snapshot in editable mode. Run yolo checks afterwards to confirm the setup.
The package declares Python 3.8 or newer and PyTorch 1.8 or newer. In practice, install the PyTorch build that matches your operating system and GPU first, using the selector on pytorch.org, then install ultralytics on top of it.
No. Prediction works on a normal CPU, and the smallest model, YOLOv8n, is designed for light hardware. Training is much faster on an NVIDIA GPU with a CUDA build of PyTorch, and Apple silicon Macs can use PyTorch's MPS backend.
Ultralytics develops YOLOv8 in its ultralytics repository on GitHub, which also hosts newer models. The download on this site comes from a separate GitHub repository that mirrors an older snapshot of that code; the GitHub guide on this site explains the difference.
Yes, but the license decides how. Under AGPL-3.0 you must release the complete source of your project, including network services built on it. To keep your code closed, Ultralytics offers a paid Enterprise License. Read the license text and get legal advice for your situation.
Yes. The Ultralytics/YOLOv8 repository on Hugging Face hosts the detection weights yolov8n.pt, yolov8s.pt, yolov8m.pt, yolov8l.pt and yolov8x.pt. You can fetch one with hf_hub_download and load it with the ultralytics YOLO class.
YOLOv8 is a Python package, so it runs wherever Python and a supported PyTorch build install, which includes common Windows, macOS and Linux systems. GPU acceleration depends on your hardware and the PyTorch build you choose.
Start with YOLOv8n or YOLOv8s for quick experiments, CPUs and edge devices. Move to YOLOv8m when you need more accuracy and have a GPU, and use YOLOv8l or YOLOv8x when accuracy matters more than speed and you have strong hardware.
YOLOv8 covers object detection, instance segmentation, image classification and pose (keypoint) estimation, plus multi-object tracking for detection, segmentation and pose models. Oriented bounding box (OBB) models were added in later ultralytics releases.
No. Ultralytics has not published a formal research paper for YOLOv8. Its documentation provides a software citation instead, listing Glenn Jocher, Ayush Chaurasia and Jing Qiu, version 8.0.0, 2023.
YOLOv8 uses an anchor-free, decoupled detection head, so it predicts object centres directly instead of adjusting preset anchor boxes. Its backbone and neck use C2f blocks, and the same design is scaled into five sizes from n to x.
Yes. Label your images, describe the dataset in a data.yaml file and run model.train(data="data.yaml", epochs=100, imgsz=640) or the equivalent yolo train command. Starting from pretrained weights usually needs fewer images and less time.
Detection uses one text file per image, with one line per object: the class index followed by the box centre x, centre y, width and height, all normalised between 0 and 1. A data.yaml file lists the train and validation paths and the class names.
Call model.export(format="onnx") in Python or run yolo export model=yolov8n.pt format=onnx. TensorRT uses format=engine and needs an NVIDIA GPU with TensorRT installed. Other targets include OpenVINO, CoreML and TensorFlow Lite.
Yes. Run yolo track model=yolov8n.pt source=video.mp4, or call model.track() in Python. Tracking assigns an ID to each object across frames and can use the BoT-SORT or ByteTrack trackers.
YOLOv8 is mature, well documented and widely used, which makes it a sound choice for learning and for existing pipelines. For brand-new projects, Ultralytics now recommends its newer YOLO26 models, which use the same package and similar commands.
The YOLOv8 and Ultralytics names and logos belong to Ultralytics. You can mention that your project uses YOLOv8, but avoid using the logo in ways that suggest endorsement. This site uses its own original mark for that reason.