YOLOv5 (original) (raw)

Ultralytics YOLOv5

Overview

YOLOv5u represents an advancement in object detection methodologies. Originating from the foundational architecture of the YOLOv5 model developed by Ultralytics, YOLOv5u integrates the anchor-free, objectness-free split head, a feature previously introduced in the YOLOv8 models. This adaptation refines the model's architecture, leading to an improved accuracy-speed tradeoff in object detection tasks. Given the empirical results and its derived features, YOLOv5u provides an efficient alternative for those seeking robust solutions in both research and practical applications.

Ultralytics YOLOv5

Key Features

Supported Tasks and Modes

The YOLOv5u models, with various pre-trained weights, excel in Object Detection tasks. They support a comprehensive range of modes, making them suitable for diverse applications, from development to deployment.

Model Type Pre-trained Weights Task Inference Validation Training Export
YOLOv5u yolov5nu, yolov5su, yolov5mu, yolov5lu, yolov5xu, yolov5n6u, yolov5s6u, yolov5m6u, yolov5l6u, yolov5x6u Object Detection

This table provides a detailed overview of the YOLOv5u model variants, highlighting their applicability in object detection tasks and support for various operational modes such as Inference, Validation, Training, and Export. This comprehensive support ensures that users can fully leverage the capabilities of YOLOv5u models in a wide range of object detection scenarios.

Performance Metrics

Usage Examples

This example provides simple YOLOv5 training and inference examples. For full documentation on these and other modes see the Predict, Train, Val and Export docs pages.

Example

PythonCLI

PyTorch pretrained *.pt models as well as configuration *.yaml files can be passed to the YOLO() class to create a model instance in python:

`from ultralytics import YOLO

Load a COCO-pretrained YOLOv5n model

model = YOLO("yolov5n.pt")

Display model information (optional)

model.info()

Train the model on the COCO8 example dataset for 100 epochs

results = model.train(data="coco8.yaml", epochs=100, imgsz=640)

Run inference with the YOLOv5n model on the 'bus.jpg' image

results = model("path/to/bus.jpg") `

CLI commands are available to directly run the models:

`# Load a COCO-pretrained YOLOv5n model and train it on the COCO8 example dataset for 100 epochs yolo train model=yolov5n.pt data=coco8.yaml epochs=100 imgsz=640

Load a COCO-pretrained YOLOv5n model and run inference on the 'bus.jpg' image

yolo predict model=yolov5n.pt source=path/to/bus.jpg `

Citations and Acknowledgements

Ultralytics YOLOv5 Publication

Ultralytics has not published a formal research paper for YOLOv5 due to the rapidly evolving nature of the models. We focus on advancing the technology and making it easier to use, rather than producing static documentation. For the most up-to-date information on YOLO architecture, features, and usage, please refer to our GitHub repository and documentation.

If you use YOLOv5 or YOLOv5u in your research, please cite the Ultralytics YOLOv5 repository as follows:

BibTeX

@software{yolov5, title = {Ultralytics YOLOv5}, author = {Glenn Jocher}, year = {2020}, version = {7.0}, license = {AGPL-3.0}, url = {https://github.com/ultralytics/yolov5}, doi = {10.5281/zenodo.3908559}, orcid = {0000-0001-5950-6979} }

Please note that YOLOv5 models are provided under AGPL-3.0 and Enterprise licenses.

FAQ

What is Ultralytics YOLOv5u and how does it differ from YOLOv5?

Ultralytics YOLOv5u is an advanced version of YOLOv5, integrating the anchor-free, objectness-free split head that enhances the accuracy-speed tradeoff for real-time object detection tasks. Unlike the traditional YOLOv5, YOLOv5u adopts an anchor-free detection mechanism, making it more flexible and adaptive in diverse scenarios. For more detailed information on its features, you can refer to the YOLOv5 Overview.

How does the anchor-free Ultralytics head improve object detection performance in YOLOv5u?

The anchor-free Ultralytics head in YOLOv5u improves object detection performance by eliminating the dependency on predefined anchor boxes. This results in a more flexible and adaptive detection mechanism that can handle various object sizes and shapes with greater efficiency. This enhancement directly contributes to a balanced tradeoff between accuracy and speed, making YOLOv5u suitable for real-time applications. Learn more about its architecture in the Key Features section.

Can I use pre-trained YOLOv5u models for different tasks and modes?

Yes, you can use pre-trained YOLOv5u models for various tasks such as Object Detection. These models support multiple modes, including Inference, Validation, Training, and Export. This flexibility allows users to leverage the capabilities of YOLOv5u models across different operational requirements. For a detailed overview, check the Supported Tasks and Modes section.

How do the performance metrics of YOLOv5u models compare on different platforms?

The performance metrics of YOLOv5u models vary depending on the platform and hardware used. For example, the YOLOv5nu model achieves a 34.3 mAP on COCO dataset with a speed of 73.6 ms on CPU (ONNX) and 1.06 ms on A100 TensorRT. Detailed performance metrics for different YOLOv5u models can be found in the Performance Metrics section, which provides a comprehensive comparison across various devices.

How can I train a YOLOv5u model using the Ultralytics Python API?

You can train a YOLOv5u model by loading a pre-trained model and running the training command with your dataset. Here's a quick example:

Example

PythonCLI

`from ultralytics import YOLO

Load a COCO-pretrained YOLOv5n model

model = YOLO("yolov5n.pt")

Display model information (optional)

model.info()

Train the model on the COCO8 example dataset for 100 epochs

results = model.train(data="coco8.yaml", epochs=100, imgsz=640) `

# Load a COCO-pretrained YOLOv5n model and train it on the COCO8 example dataset for 100 epochs yolo train model=yolov5n.pt data=coco8.yaml epochs=100 imgsz=640

For more detailed instructions, visit the Usage Examples section.