Roboflow

YOLOv5 Overview

YOLOv5 is an object detection model developed by Ultralytics, released in June 2020 under the AGPL-3.0 license. It is implemented in PyTorch and introduced a more accessible and well-documented YOLO implementation compared to earlier Darknet-based versions, with an integrated training and export pipeline supporting a wide range of deployment targets. YOLOv5 uses a CSP backbone, PANet neck, and a single-stage detection head with anchor-based regression.

YOLOv5 is available in five sizes from Nano to Extra Large and supports export to ONNX, TensorRT, CoreML, and other formats. It is one of the most widely deployed object detection models in production environments and remains a common starting point for custom detection model training due to its documentation, community support, and compatibility with Roboflow Inference.

YOLOv5 Details & Performance

Vision Tasks

Object Detection

Features

Real-Time Vision

Usage

Past 30 Days

Not available

Not in Playground

Performance

Avg. Latency

Arena Rankings

Not yet ranked in arena

YOLOv5 Explained

YOLO (You Only Look Once) is a family of real time object detection models introduced by Joseph Redmon in 2016. YOLO models are known for strong performance and small model size, which makes them suitable for real time and on-device deployment.

Redmon and collaborators later introduced YOLOv2 and YOLOv3, which improved both accuracy and speed. In February 2020, Redmon announced that he would discontinue research in computer vision.

In April 2020, Alexey Bochkovskiy, Chien-Yao Wang, and Hong-Yuan Mark Liao introduced YOLOv4, which provided significant gains in accuracy and speed. Many of these gains came from improved data augmentation as well as architectural changes.

YOLOv5 was released shortly after YOLOv4. At release, it was among the leading realtime object detectors.

YOLOv5 is the first YOLO family release that is implemented natively in PyTorch rather than in the original Darknet framework.

Darknet is a flexible research framework, but it has a smaller user community and is not designed primarily for production deployment. This can make Darknet based models more difficult to configure and integrate into production systems.

By using PyTorch as the primary implementation framework, YOLOv5 benefits from:

  • A larger ecosystem and community for support and experimentation.
  • Easier iteration by the broader research and engineering community.
  • Simpler deployment to production environments that already use PyTorch.
  • Straightforward export to common deployment formats such as ONNX and CoreML, which helps with mobile and embedded deployment.

Glenn Jocher, the author of YOLOv5, is also the creator of mosaic augmentation, a data augmentation technique that contributed to the improvements in YOLOv4. Mosaic augmentation is part of the training strategy around YOLOv5.

YOLOv5 is released in multiple model sizes to cover different latency and resource budgets:

  • YOLOv5s (smallest)
  • YOLOv5m
  • YOLOv5l
  • YOLOv5x (largest)

Inference speed

On a Tesla P100 GPU in a Colab environment, YOLOv5 achieved inference times of about 0.007 seconds per image in batch, which corresponds to approximately 140 frames per second (FPS). Under the same Ultralytics PyTorch implementation, YOLOv4 achieved about 50 FPS.

When batch size is set to 1, YOLOv4 reached about 30 FPS and YOLOv5 about 10 FPS in the reported tests. The 140 FPS figure refers to batched inference, which the tested YOLOv5 implementation uses by default.

Accuracy

On the blood cell count and detection (BCCD) dataset, YOLOv5 reached a mean average precision (mAP) of roughly 0.895 after training for 100 epochs. In the same context, EfficientDet and YOLOv4 achieved comparable accuracy. YOLOv5 therefore provided strong accuracy while also improving aspects such as deployment and model size.

Model size and deployability

YOLOv5 places emphasis on compact model weights, which simplifies deployment to resource constrained environments.

  • The YOLOv5s weights file is about 27 MB.
  • A Darknet based “big YOLOv4” weights file used for comparison is about 250 MB.
  • The largest YOLOv5 implementation, YOLOv5l, is about 192 MB.

In this comparison, YOLOv5s is nearly 90 percent smaller than the referenced YOLOv4 model. This size reduction makes YOLOv5 more practical for embedded and mobile deployment while still providing competitive accuracy.

COCO AP val vs GPU latency (ms) for YOLOv5s, YOLOv5m, YOLOv5l, YOLOv5x, EfficientDet.
YOLO is more accurate and faster than EfficientDet. Credit: Glenn Jocher

At release, YOLOv5 was reported to be more accurate and faster than EfficientDet in the referenced benchmark graphic.

YOLOv4 introduced many improvements through both architecture and data augmentation. Mosaic augmentation, which was later associated with YOLOv5’s author, was one of the techniques that contributed to YOLOv4’s gains.

Relative to YOLOv4 and EfficientDet, YOLOv5 offered the following characteristics in the reported tests:

  • Similar accuracy on the BCCD dataset, with mAP around 0.895 after 100 epochs.
  • Higher batched inference throughput on a Tesla P100 GPU, with about 140 FPS compared to about 50 FPS for YOLOv4 under the same PyTorch based implementation.
  • Much smaller model size for YOLOv5s compared to a large YOLOv4 Darknet model, which improved suitability for embedded and mobile deployment.

These comparisons are specific to the described experimental setup, including hardware, batch size, and model variants.

YOLOv5 is designed for practical use in realtime detection scenarios and on-device applications. Key practical aspects include:

  • Native PyTorch implementation, which integrates with common training workflows and tooling.
  • Support for export to ONNX and CoreML, which enables deployment to a wide range of platforms, including mobile and embedded devices.
  • Multiple model sizes (YOLOv5s, YOLOv5m, YOLOv5l, YOLOv5x), which allow users to trade off accuracy, speed, and memory footprint based on application requirements.

At release, YOLOv5 was accompanied by example training workflows on custom datasets and by references to using standard COCO pretrained weights. These resources demonstrated how to adapt YOLOv5 to new domains and how to run inference in production like environments.

Alternatives to YOLOv5

Other models worth comparing for similar use cases.

YOLOv8
YOLOv8 is an object detection and multi-task vision model developed by Ultralytics, released in January 2023 under the AGPL-3.0 license. It succeeds YOLOv5 and introduces an anchor-free detection head, a new C2f module for improved gradient flow, and a decoupled head that separates classification and regression tasks. These changes improve both accuracy and training efficiency compared to earlier Ultralytics models.YOLOv8 supports object detection, instance segmentation, image classification, pose estimation, and oriented bounding box detection within a unified codebase. It is available in five sizes from Nano to Extra Large and exports to ONNX, TensorRT, CoreML, and other formats. YOLOv8 is one of the most widely adopted detection models in production and is directly supported by Roboflow Inference for custom model training and deployment.
YOLO11
YOLO11 is an object detection and multi-task vision model developed by Ultralytics, released in September 2024 under the AGPL-3.0 license. It is the latest generation in the Ultralytics YOLO series and supports object detection, instance segmentation, image classification, pose estimation, and oriented bounding box detection within a single unified framework. YOLO11 introduces architectural refinements that improve accuracy while reducing parameter count compared to YOLOv8 at equivalent model sizes.YOLO11 is available in five model sizes from Nano to Extra Large and is deployable through the Ultralytics Python package, Roboflow Inference, and export formats including ONNX, TensorRT, and CoreML. It supports fine-tuning on custom datasets through the standard Ultralytics training API.
YOLOv9
YOLOv9 is a real-time object detection model developed by Chien-Yao Wang and Hong-Yuan Mark Liao at Academia Sinica, released in February 2024 under the GPL-3.0 license. It introduces Programmable Gradient Information (PGI), a mechanism that preserves complete input information through auxiliary reversible branches during training to address information loss in deep network layers. It also introduces the Generalized Efficient Layer Aggregation Network (GELAN), which achieves better parameter utilization compared to prior CSP-based designs.YOLOv9-C achieves 53.0% AP on COCO with 42% fewer parameters and 21% less computation than YOLOv8-C at comparable accuracy. YOLOv9-E achieves 55.6% AP. The model is deployable through Roboflow Inference and supports fine-tuning via the standard training pipeline in the official repository.
YOLOX
YOLOX is an anchor-free object detection model developed by Megvii (Face++), released in July 2021 under the Apache 2.0 license. It applies anchor-free detection to the YOLO framework, decoupling the classification and regression heads to allow each to optimize independently, and introduces the SimOTA label assignment strategy for improved training convergence. YOLOX achieves strong accuracy-speed tradeoffs and outperforms YOLOv5 on COCO at comparable model sizes.YOLOX-L achieves 50.0% AP on COCO at 68.9 FPS on an NVIDIA V100 GPU. The model is available in a range of sizes from YOLOX-Nano to YOLOX-X and supports deployment through ONNX, TensorRT, and other standard export formats. It is suitable for real-time object detection applications and has been widely adopted in industrial and research detection pipelines.
Baidu
RT-DETR
RT-DETR (Real-Time Detection Transformer) is an object detection model developed by Baidu, released in April 2023 under the Apache 2.0 license. It is the first transformer-based real-time object detector, addressing the inference speed limitations of earlier DETR models through an efficient hybrid encoder that decouples intra-scale interaction and cross-scale fusion, enabling the model to process multi-scale features without the high computational overhead of standard transformer encoders.RT-DETR achieves 53.1% AP on COCO at 108 FPS on an NVIDIA T4 GPU for the RT-DETR-L variant, outperforming comparably sized YOLO detectors at similar speeds. It maintains end-to-end inference without non-maximum suppression, simplifying deployment pipelines. RT-DETR established the baseline for real-time transformer detection and has been extended by subsequent works including RF-DETR and RT-DETRv2.

YOLOv5 License

AGPL-3.0

License terms and commercial-use guidance for YOLOv5.

YOLOv5 is licensed under an AGPL-3.0 license.

This means that YOLOv5 is available for private and commercial use, but that you will need to follow specific conditions. For commercial use, you need to follow AGPL-3.0 conditions or purchase a license for commercial use, modifications, and distribution.

Using an AGPL-3.0 licensed model is conditioned on making available complete source code of licensed works and modifications, which include larger works using a licensed work, under the same license. Copyright and license notices must be preserved. Contributors provide an express grant of patent rights. When a modified version is used to provide a service over a network, the complete source code of the modified version must be made available.

Read the full AGPL-3.0 license ↗

To use YOLOv5 in a commercial project without the AGPL-3.0 conditions, you need a license. As a paid Roboflow customer, you automatically get access to use any YOLOv5 models trained on or uploaded to our platform for commercial use. This is secured under Roboflow's sub-license agreement with Ultralytics, the creators of YOLOv5.

If you are a free Roboflow customer, you can use YOLOv5 in any way if using our serverless hosted API and can use YOLOv5 models commercially self-hosted with a paid plan.

To learn more about model licensing with Roboflow, refer to our Licensing guide.

AGPL-3.0 closes the "SaaS loophole" in GPL-3.0: even hosting the model behind an API counts as distribution and triggers the source-disclosure requirement.

License information is provided as a guide and is not legal advice.