Back to Ultralytics

YOLO How-To Guides

docs/en/guides/index.md

8.4.10414.5 KB
Original Source

Comprehensive Tutorials for Ultralytics YOLO

Welcome to Ultralytics' YOLO Guides. Our comprehensive tutorials cover various aspects of the YOLO object detection model, ranging from training and prediction to deployment. Built on PyTorch, YOLO stands out for its exceptional speed and accuracy in real-time object detection tasks.

Whether you're a beginner or an expert in deep learning, our tutorials offer valuable insights into the implementation and optimization of YOLO for your computer vision projects.

<p align="center"> <iframe loading="lazy" width="720" height="405" src="https://www.youtube.com/embed/96NkhsV-W1U" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen> </iframe>

<strong>Watch:</strong> Ultralytics YOLO26 Guides Overview

</p>

Guides

Guides are grouped by project stage — from environment setup and data preparation through training, evaluation, deployment, inference optimization, and edge hardware — so you can jump straight to the step you're working on.

Get started & plan

  • Conda Quickstart: Step-by-step guide to setting up a Conda environment for Ultralytics. Learn how to install and start using the Ultralytics package efficiently with Conda.
  • Docker Quickstart: Complete guide to setting up and using Ultralytics YOLO models with Docker. Learn how to install Docker, manage GPU support, and run YOLO models in isolated containers for consistent development and deployment.
  • AzureML Quickstart: Get up and running with Ultralytics YOLO models on Microsoft's Azure Machine Learning platform. Learn how to train, deploy, and scale your object detection projects in the cloud.
  • Modal Quickstart: Run Ultralytics YOLO26 on Modal's serverless cloud platform, covering authentication, GPU inference, and training jobs with persistent storage — no infrastructure to manage.
  • Defining A Computer Vision Project's Goals: Walk through how to effectively define clear and measurable goals for your computer vision project. Learn the importance of a well-defined problem statement and how it creates a roadmap for your project.
  • Steps of a Computer Vision Project: Learn about the key steps involved in a computer vision project, including defining goals, selecting models, preparing data, and evaluating results.
  • YOLO Architecture Explained: Trace how the YOLO architecture evolved from YOLOv3 to YOLO26 across backbone, neck, and detection head, covering C2f, C3k2, C2PSA attention, anchor-free, and NMS-free design.

Prepare your data

  • Data Collection and Annotation: Explore the tools, techniques, and best practices for collecting and annotating data to create high-quality inputs for your computer vision models.
  • Preprocessing Annotated Data: Learn data preprocessing for computer vision with YOLO26, including image resizing, normalization, dataset splitting, data augmentation, and exploratory data analysis (EDA).
  • YOLO Data Augmentation: Master the complete range of data augmentation techniques in YOLO, from basic transformations to advanced strategies for improving model robustness and performance.
  • COCO to YOLO Conversion: Complete guide to converting COCO JSON annotations to YOLO format for training. Covers detection, segmentation, and keypoints, including class ID mapping and common conversion pitfalls.
  • COCO JSON Training: Train YOLO directly on COCO JSON annotations without converting to YOLO format, using a custom dataset class and trainer.

Train & fine-tune

  • Tips for Model Training: Explore tips on optimizing batch sizes, using mixed precision, applying pretrained weights, and more to make training your computer vision model a breeze.
  • Fine-Tuning YOLO on Custom Data: Complete guide to fine-tuning YOLO26 on custom datasets with pretrained weights, covering transfer learning, layer freezing, optimizer selection, two-stage training, and troubleshooting.
  • YOLO26 Training Recipe: Full documentation of the hyperparameters, augmentation pipelines, and optimizer settings used to train the official YOLO26 base checkpoints on COCO, with practical fine-tuning guidance.
  • Hyperparameter Tuning: Discover how to optimize your YOLO models by fine-tuning hyperparameters using the Tuner class and genetic evolution algorithms.
  • Knowledge Distillation: Learn how to improve model performance by transferring knowledge from a larger teacher model to a smaller student model using feature-based distillation.
  • K-Fold Cross Validation: Learn how to improve model generalization using K-Fold cross-validation technique.
  • Customizing Trainer: Learn how to subclass the YOLO trainer to log custom metrics, add class-weighted loss, customize model saving, freeze/unfreeze the backbone, and set per-layer learning rates.
  • Model YAML Configuration Guide: A comprehensive deep dive into Ultralytics' model architecture definitions. Explore the YAML format, understand the module resolution system, and learn how to integrate custom modules seamlessly.

Evaluate & troubleshoot

  • YOLO Performance Metrics ⭐ ESSENTIAL: Understand the key metrics like mAP, IoU, and F1 score used to evaluate the performance of your YOLO models. Includes practical examples and tips on how to improve detection accuracy and speed.
  • Insights on Model Evaluation and Fine-Tuning: Evaluate computer vision models with metrics like mAP and IoU, then fine-tune training parameters such as learning-rate warmup to improve detection accuracy.
  • Model Testing: Learn how to test computer vision models on unseen data, validate YOLO26 models, and catch overfitting, underfitting, and data leakage before deployment.
  • YOLO Common Issues ⭐ RECOMMENDED: Practical solutions and troubleshooting tips to the most frequently encountered issues when working with Ultralytics YOLO models.
  • Maintaining Your Computer Vision Model: Understand the key practices for monitoring, maintaining, and documenting computer vision models to guarantee accuracy, spot anomalies, and mitigate data drift.

Deploy & serve

  • Model Deployment Options: Overview of YOLO model deployment formats like ONNX, OpenVINO, and TensorRT, with pros and cons for each to inform your deployment strategy.
  • Best Practices for Model Deployment: Walk through tips and best practices for efficiently deploying models in computer vision projects, with a focus on optimization, troubleshooting, and security.
  • Export Non-YOLO Models: Use Ultralytics standalone export utilities to convert any torch.nn.Module (timm, torchvision, custom) to ONNX, TorchScript, OpenVINO, CoreML, NCNN, MNN, PaddlePaddle, ExecuTorch, and TensorFlow SavedModel.
  • End-to-End Detection: Understand YOLO26's NMS-free end-to-end detection, export compatibility, output format changes, and how to migrate from older YOLO models.
  • Triton Inference Server Integration: Dive into the integration of Ultralytics YOLO26 with NVIDIA's Triton Inference Server for scalable and efficient deep learning inference deployments.
  • YOLO Thread-Safe Inference: Guidelines for performing inference with YOLO models in a thread-safe manner. Learn the importance of thread safety and best practices to prevent race conditions and ensure consistent predictions.
  • ROS Quickstart: Learn how to integrate YOLO with the Robot Operating System (ROS) for real-time object detection in robotics applications, including Point Cloud and Depth images.
  • Vertex AI Deployment with Docker: Streamlined guide to containerizing YOLO models with Docker and deploying them on Google Cloud Vertex AI—covering build, push, autoscaling, and monitoring.

Optimize inference

  • SAHI Tiled Inference: Comprehensive guide on leveraging SAHI's sliced inference capabilities with YOLO26 for object detection in high-resolution images.
  • OpenVINO Latency vs Throughput Modes: Learn latency and throughput optimization techniques for peak YOLO inference performance.
  • NVIDIA DALI GPU Preprocessing: Eliminate CPU preprocessing bottlenecks by running YOLO letterbox resize, padding, and normalization on the GPU using NVIDIA DALI, with Triton Inference Server integration.
  • Isolating Segmentation Objects: Step-by-step recipe and explanation on how to extract and/or isolate objects from images using Ultralytics Segmentation.
  • View Inference Images in a Terminal: Use VSCode's integrated terminal to view inference results when using Remote Tunnel or SSH sessions.

Edge & embedded hardware

Contribute to Our Guides

We welcome contributions from the community! If you've mastered a particular aspect of Ultralytics YOLO that's not yet covered in our guides, we encourage you to share your expertise. Writing a guide is a great way to give back to the community and help us make our documentation more comprehensive and user-friendly.

To get started, please read our Contributing Guide for guidelines on how to open a Pull Request (PR). When adding a new guide, place it under the category above that matches its project stage and keep it to a single page type — a step-by-step tutorial, a task-focused how-to, or a reference — so the collection stays easy to browse as it grows. We look forward to your contributions.

FAQ

How do I train a custom object detection model using Ultralytics YOLO?

Training a custom object detection model with Ultralytics YOLO is straightforward. Start by preparing your dataset in the correct format and installing the Ultralytics package. Use the following code to initiate training:

!!! example

=== "Python"

    ```python
    from ultralytics import YOLO

    model = YOLO("yolo26n.pt")  # Load a pretrained YOLO model
    model.train(data="path/to/dataset.yaml", epochs=50)  # Train on custom dataset
    ```

=== "CLI"

    ```bash
    yolo task=detect mode=train model=yolo26n.pt data=path/to/dataset.yaml epochs=50
    ```

For detailed dataset formatting and additional options, refer to our Tips for Model Training guide.

What performance metrics should I use to evaluate my YOLO model?

Evaluating your YOLO model performance is crucial to understanding its efficacy. Key metrics include Mean Average Precision (mAP), Intersection over Union (IoU), and F1 score. These metrics help assess the accuracy and precision of object detection tasks. You can learn more about these metrics and how to improve your model in our YOLO Performance Metrics guide.

Why should I use Ultralytics Platform for my computer vision projects?

Ultralytics Platform is a no-code platform that simplifies managing, training, and deploying YOLO models. It supports seamless integration, real-time tracking, and cloud training, making it ideal for both beginners and professionals. Discover more about its features and how it can streamline your workflow with our Ultralytics Platform quickstart guide.

What are the common issues faced during YOLO model training, and how can I resolve them?

Common issues during YOLO model training include data formatting errors, model architecture mismatches, and insufficient training data. To address these, ensure your dataset is correctly formatted, check for compatible model versions, and augment your training data. For a comprehensive list of solutions, refer to our YOLO Common Issues guide.

How can I deploy my YOLO model for real-time object detection on edge devices?

Deploying YOLO models on edge devices like NVIDIA Jetson and Raspberry Pi requires converting the model to a compatible format such as TensorRT or LiteRT. Follow our step-by-step guides for NVIDIA Jetson and Raspberry Pi deployments to get started with real-time object detection on edge hardware. These guides will walk you through installation, configuration, and performance optimization.