Roboflow

UltralyticsReleased Jan 2020AGPL 3.0

YOLOv5

We don't benchmark YOLOv5.

It is an open-weight model from Ultralytics under the AGPL 3.0 license, and commercial use needs a license (included on Roboflow cloud).

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 License

AGPL-3.0 · Restrictive license

YOLOv5 is released under AGPL-3.0, the most restrictive of the common model licenses. AGPL-3.0 requires the user to open-source any code changes they make, including the code of any other projects that connect directly to the model, so the YOLOv5 license usually means a separate commercial license for business use.

Commercial use
Permitted only if you are willing and able to open-source related code. Otherwise YOLOv5 requires a separate commercial license — the usual path for businesses.
Modification
Permitted. Modified versions must be offered under AGPL-3.0, including to users who only ever reach the model over a network.
Redistribution
Permitted with the complete corresponding source, under the same license.

Serving YOLOv5 behind an API or inside a hosted product counts: AGPL-3.0 reaches the code of other projects that connect directly to the model, which is what catches most commercial deployments by surprise.

Read the full AGPL-3.0 license ↗

Do I need a commercial license for YOLOv5?

In practice, using YOLOv5 in a commercial product or service, including one users reach over a network, means open-sourcing your application code under AGPL-3.0 or buying a commercial license. Deploying on Roboflow includes a commercial YOLOv5 license for every user, including the free plan; commercial self-hosting is an Enterprise add-on. Licensing details. Need a permissive license? RF-DETR is Apache 2.0.

Do not hesitate to reach out with questions for your commercial project. Our team will help you start solving business problems on the first call. See Roboflow commercial licensing for the models included in each plan.

Talk to sales

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.

YOLOv5 is released under AGPL-3.0. In practice, using it in a commercial product or service, including one users reach over a network, means open-sourcing your application code under AGPL-3.0 or buying a commercial license. Deploying on Roboflow includes a commercial YOLOv5 license for every user; commercial self-hosting is an Enterprise add-on (details). Need a permissive license? RF-DETR is Apache 2.0.

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.

YOLOv5 Details

Details

Categoryopen
ModalityVision
Parameters1.9M-86.7M
LicenseAGPL-3.0
Release DateJan 2020

Vision Tasks

Object Detection

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.