


YOLOv8: Fast and Accurate Computer Vision
YOLOv8 is a computer vision model family designed for fast, accurate analysis of images and videos. It can identify objects, locate them with bounding boxes, segment individual objects, classify images, estimate human poses, and detect rotated objects. Its balance of speed, accuracy, and ease of use makes it suitable for learning, research, prototyping, and real-world computer vision projects.
This homepage explains what YOLOv8 is, how to install it, how to run predictions, and how to train, validate, and export a custom model. It also covers key features, available model sizes, common applications, and practical learning resources.
Experience YOLOv8
YOLOv8 can analyze an image in a single inference workflow and return the detected object classes, confidence scores, and bounding box coordinates. A pretrained detection model can recognize common objects such as people, vehicles, animals, furniture, and everyday items.
To test the basic workflow, select an image from your device and run it through a pretrained YOLOv8 model. The result displays labels and boxes around recognized objects. Use images that you own or have permission to process, and avoid uploading private or sensitive material.
What the Result Shows
- Class: the category assigned to a detected object.
- Confidence: the model's estimated certainty for that prediction.
- Bounding box: the coordinates that locate the object in the image.
- Multiple detections: separate results for each recognized object.
What Is YOLOv8?
YOLOv8 is a deep-learning model family released by Ultralytics in 2023 as part of the wider YOLO, or You Only Look Once, approach to computer vision. YOLO models are known for processing an image efficiently and predicting object locations and classes without a slow multi-stage detection pipeline.
YOLOv8 is not limited to object detection. Different model variants support instance segmentation, image classification, pose estimation, and oriented bounding boxes. This unified workflow lets developers use similar commands and Python methods across several computer vision tasks.
Why YOLOv8 Is Popular
- Fast inference for images, videos, and live streams.
- Pretrained weights that make it easy to begin testing.
- Several model sizes for different accuracy and hardware requirements.
- Simple command-line and Python interfaces.
- Built-in workflows for training, validation, prediction, tracking, and export.
- Support for custom datasets and deployment formats.
How to Install YOLOv8
YOLOv8 is available through the Ultralytics Python package. Use a current Python environment and install the latest stable package with pip:
pip install -U ultralyticsAfter installation, confirm that the command-line interface is available:
yolo checksA virtual environment is recommended because it keeps project dependencies separate. GPU acceleration requires a compatible PyTorch and hardware setup, but the package can also run on a CPU for basic testing.
Run Your First YOLOv8 Prediction
The small yolov8n.pt detection model is a practical starting point. The model weights are downloaded automatically the first time they are used.
Prediction with the Command Line
yolo predict model=yolov8n.pt source="path/to/image.jpg"Replace the example source with the path to your image, video, folder, or supported stream. Prediction results are saved in the runs directory by default.
Prediction with Python
from ultralytics import YOLO
model = YOLO("yolov8n.pt")
results = model.predict(source="path/to/image.jpg", save=True)
for result in results:
print(result.boxes)The returned results contain detected boxes, class identifiers, confidence values, and other task-specific output. You can display, save, filter, or convert these results for use in another application.
How to Use YOLOv8
The Ultralytics interface uses modes for the main stages of a computer vision project. The most common modes are predict, train, val, export, and track.
Predict
Use predict mode to run a pretrained or custom model on new images, videos, directories, live cameras, or streams.
yolo predict model=yolov8n.pt source="path/to/video.mp4"Train
Use train mode to adapt a pretrained YOLOv8 model to a labeled custom dataset. The dataset configuration file defines the training and validation image locations, class count, and class names.
yolo train model=yolov8n.pt data="path/to/dataset.yaml" epochs=50 imgsz=640Validate
Use validation mode to measure how well a model performs on the validation split. The output includes metrics such as precision, recall, and mean average precision.
yolo val model="path/to/best.pt" data="path/to/dataset.yaml"Export
Use export mode to convert a trained model to a format suited to a deployment environment. ONNX is a common option for cross-platform inference.
yolo export model="path/to/best.pt" format=onnxTrack
Tracking combines detections across video frames so that the same object can retain an identity while it moves through a scene.
yolo track model=yolov8n.pt source="path/to/video.mp4"Train a Custom YOLOv8 Model
A custom model learns the objects and visual patterns found in your own dataset. Good labels and representative images matter more than simply increasing the number of training epochs.
1. Define the Task
Choose detection when you need bounding boxes, segmentation when you need object masks, classification when each image needs a category, or pose estimation when you need keypoints.
2. Collect Representative Images
Include the lighting, camera angles, object sizes, backgrounds, and environmental conditions the model will encounter after deployment. Keep training and evaluation data representative of the real use case.
3. Label the Dataset
Apply consistent class names and accurate annotations. Incorrect, missing, or inconsistent labels can limit performance even when the dataset is large.
4. Create the Dataset Configuration
A detection dataset configuration can look like this:
path: path/to/dataset
train: images/train
val: images/val
names:
0: first_class
1: second_class5. Start from Pretrained Weights
Transfer learning from a pretrained model usually provides a faster and more practical starting point than training the entire network from random initialization.
from ultralytics import YOLO
model = YOLO("yolov8n.pt")
model.train(
data="path/to/dataset.yaml",
epochs=50,
imgsz=640
)6. Review the Results
Inspect training curves, validation metrics, confusion patterns, and sample predictions. Look beyond one headline metric: check which classes are missed, which classes are confused, and how the model behaves on difficult real-world examples.
YOLOv8 Model Sizes
YOLOv8 provides several model sizes. The right choice depends on available memory, target hardware, required latency, and acceptable accuracy.
| Model | Relative Size | Typical Use |
|---|---|---|
| YOLOv8n | Nano | Fast tests, edge devices, and low-resource environments |
| YOLOv8s | Small | Lightweight applications that need a stronger accuracy balance |
| YOLOv8m | Medium | General projects with moderate computing resources |
| YOLOv8l | Large | Accuracy-focused workloads with capable hardware |
| YOLOv8x | Extra large | High-capacity inference and training where speed is less restrictive |
Start with YOLOv8n or YOLOv8s while building the pipeline. Once the data and evaluation process are reliable, compare larger models under the same test conditions before making a deployment choice.
Computer Vision Tasks Supported by YOLOv8
Object Detection
Object detection identifies each recognized object and places a rectangular bounding box around it. Detection is useful when both the class and location of an object matter.
Instance Segmentation
Instance segmentation produces a detailed mask for each object instead of only a rectangular box. It is useful when shape, occupied area, or object boundaries are important.
Image Classification
Classification assigns a category to an entire image. It is suitable when the goal is to identify the main type or condition represented by the image.
Pose Estimation
Pose models identify keypoints that represent body joints or other structured landmarks. They can support movement analysis, exercise feedback, and human-computer interaction.
Oriented Object Detection
Oriented bounding boxes include rotation, making them useful for aerial images, documents, industrial parts, and other scenes where objects do not remain horizontally aligned.
Main Features of YOLOv8
- Anchor-free detection: YOLOv8 predicts object centers without relying on predefined anchor boxes.
- Multiple task variants: related model families cover detection, segmentation, classification, pose, and oriented boxes.
- Pretrained models: ready-to-use weights help users begin inference or transfer learning quickly.
- Unified interface: consistent CLI commands and Python methods cover the main workflow.
- Training augmentation: configurable transformations help models learn from more varied visual conditions.
- Flexible deployment: trained models can be exported to formats used by different runtimes and devices.
- Video tracking: compatible tracking workflows can associate detected objects across frames.
Who Created YOLOv8?
Ultralytics developed and released YOLOv8. The model belongs to the broader history of YOLO-based object detection, which began with research by Joseph Redmon, Santosh Divvala, Ross Girshick, and Ali Farhadi. Later YOLO versions were created by different researchers and organizations, while Ultralytics built YOLOv8 and its integrated training and deployment workflow.
Before using YOLOv8 in a public, commercial, or embedded product, review the license terms that apply to the software, trained models, and your intended distribution method.
A Quick History of the YOLO Model Family
- Original YOLO: introduced single-stage real-time object detection and helped reshape how developers approached fast vision models.
- YOLOv2 and YOLOv3: improved detection across object sizes and expanded the original approach.
- YOLOv4: combined an efficient architecture with training improvements aimed at strong speed and accuracy.
- YOLOv5: popularized an accessible PyTorch-based development workflow.
- YOLOv6 and YOLOv7: explored additional architecture and training improvements for real-time detection.
- YOLOv8: introduced Ultralytics' anchor-free model family with support for several computer vision tasks.
Version numbers in the YOLO ecosystem do not represent one uninterrupted project owned by a single team. Different versions have come from different authors and organizations.
Popular Uses for YOLOv8
Traffic and Transport Analysis
YOLOv8 can detect vehicles, pedestrians, bicycles, and other road objects in recorded or live footage. These detections can support traffic counts, movement analysis, and transport research when deployed with appropriate privacy and safety controls.
Manufacturing and Quality Inspection
A custom model can identify products, components, missing parts, or visible defects on a production line. Reliable deployment requires representative training data and testing under real factory conditions.
Retail and Inventory Monitoring
Object detection can help count products, identify empty shelf areas, and monitor item placement. The model should be evaluated carefully when products have similar packaging or are partially hidden.
Agriculture
YOLOv8 can support crop, fruit, animal, and equipment detection. Models trained on local field conditions can assist with counting, monitoring, and visual inspection tasks.
Sports Analysis
Video detection and tracking can locate players, equipment, and field events. A specialized dataset is usually needed because camera angles, motion, and object size vary across sports.
Robotics
Robots can use object detections as part of a larger perception system for navigation, sorting, inspection, and interaction. Detection output should be combined with appropriate sensors and control logic.
Medical and Scientific Imaging
Researchers can train vision models to identify patterns in specialized images. Any clinical application requires expert oversight, representative data, rigorous validation, and compliance with applicable standards. Model output should not be treated as a diagnosis by itself.
Augmented Reality
Real-time detection can help an application recognize physical objects and position contextual digital content around them.
Example YOLOv8 Project Ideas
Vehicle and License Plate Detection
Build a model that locates vehicles and visible license plates in controlled images. Use lawfully collected data and apply suitable privacy protections.
Aerial Image Detection
Train a model to identify buildings, vehicles, fields, or equipment in drone and satellite images. Oriented bounding boxes may help when objects appear at many angles.
Warehouse Item Detection
Detect pallets, boxes, forklifts, or safety equipment in warehouse footage. Include occlusion, low light, varied viewing angles, and real camera positions in the evaluation data.
Object Tracking and Counting
Combine detection with tracking to count objects that cross a defined line or enter a region. Test the system for duplicate counts, missed detections, and crowded scenes.
How to Evaluate a YOLOv8 Model
Precision
Precision measures how many reported detections are correct. Low precision usually means the model produces too many false positives.
Recall
Recall measures how many relevant objects the model successfully finds. Low recall indicates that important objects are being missed.
Intersection over Union
Intersection over Union compares a predicted box with the ground-truth box. It helps determine whether the predicted location is accurate enough to count as a correct detection.
Mean Average Precision
Mean average precision summarizes detection quality across classes and confidence thresholds. Compare it alongside per-class results, precision, recall, speed, and real-world failure cases.
Inference Speed
Measure latency on the actual device and input size planned for deployment. Results from a different GPU, CPU, batch size, or image resolution may not represent your application.
YOLOv8 Learning Resources
Use the following learning path to move from a first prediction to a reliable custom model:
- Install the Ultralytics package in a separate Python environment.
- Run a pretrained YOLOv8n model on several images and videos.
- Inspect classes, confidence scores, bounding boxes, and saved results.
- Learn the annotation format for your chosen computer vision task.
- Prepare a small, carefully labeled custom dataset.
- Train a pretrained model and review validation results.
- Test predictions on new images that were not used during training.
- Compare model sizes and export formats on the target hardware.
Recommended Topics to Study
- How YOLOv8 detection works
- Dataset collection and annotation quality
- Training configuration and augmentation
- Precision, recall, IoU, and mAP
- Confusion matrices and class-level errors
- Object tracking and counting
- Model export and device-specific optimization
Latest YOLOv8 Guides
How to Calculate COCO Metrics for a YOLOv8 Segmentation Model
Learn how to validate a segmentation model and interpret the metrics used to compare predicted masks with labeled data.
Interpreting YOLOv8 Metrics: mAP, IoU, Precision, and Recall
Understand what the main evaluation metrics measure and why model quality should be judged with more than one number.
Which Algorithm Does YOLOv8 Use?
Explore the single-stage detection workflow, anchor-free predictions, and the role of the backbone, neck, and detection head.
How Many Classes Are in YOLOv8?
Learn why the available classes depend on the dataset and how to define your own classes for a custom model.
Real-World Applications of YOLOv8
Review practical uses of detection, segmentation, pose estimation, and tracking across different industries.
Frequently Asked Questions
Is YOLOv8 only for object detection?
No. YOLOv8 model variants support object detection, instance segmentation, image classification, pose estimation, and oriented object detection.
Which YOLOv8 model should a beginner use?
YOLOv8n is a sensible starting point because it is small and quick to test. Compare it with YOLOv8s or a larger model after the complete data and evaluation pipeline is working.
Can YOLOv8 run without a GPU?
Yes. It can run on a CPU, although training and inference are generally faster on compatible accelerated hardware.
Can I train YOLOv8 on my own objects?
Yes. Prepare labeled training and validation data, define the classes in a dataset configuration file, and fine-tune a pretrained model.
What image size should I use?
An image size of 640 pixels is a common starting point for detection. The best choice depends on object size, available memory, inference speed, and the detail needed for the project.
Why does my model miss small objects?
Small objects may occupy too few pixels, be underrepresented in the training data, or be lost after image resizing. Improve relevant labels, add representative examples, test a larger input size, and review predictions at different confidence settings.
How do I know whether a model is ready to deploy?
Test it on unseen, representative data and on the intended hardware. Review per-class performance, failure cases, latency, memory usage, stability, and the impact of incorrect predictions in the real application.