[assets]: https://github.com/ultralytics/yolov5/releases
[TTA]: https://github.com/ultralytics/yolov5/issues/303
This release incorporates many new features and bug fixes ([**465 PRs** from **73 contributors**](https://github.com/ultralytics/yolov5/compare/v5.0...v6.0)) since our last [release v5.0](https://github.com/ultralytics/yolov5/releases/tag/v5.0) in April, brings architecture tweaks, and also introduces new P5 and P6 'Nano' models: **YOLOv5n** and **YOLOv5n6**. Nano models maintain the YOLOv5s depth multiple of 0.33 but reduce the YOLOv5s width multiple from 0.50 to 0.25, resulting in ~75% fewer parameters, from 7.5M to 1.9M, ideal for mobile and CPU solutions.
Example usage:
bash
python detect.py --weights yolov5n.pt --img 640 Nano P5 model trained at --img 640 (28.4 mAP0.5:0.95)
python detect.py --weights yolov5n6.pt --img 1280 Nano P6 model trained at --img 1280 (34.0 mAP0.5:0.95)
Important Updates
- **Roboflow Integration ⭐ NEW**: Train YOLOv5 models directly on any Roboflow dataset with our new integration! (https://github.com/ultralytics/yolov5/issues/4975 by Jacobsolawetz)
- **YOLOv5n 'Nano' models ⭐ NEW**: New smaller YOLOv5n (1.9M params) model below YOLOv5s (7.5M params), exports to 2.1 MB INT8 size, ideal for ultralight mobile solutions. (https://github.com/ultralytics/yolov5/discussions/5027 by glenn-jocher)
- **TensorFlow and Keras Export**: TensorFlow, Keras, TFLite, TF.js model export now fully integrated using `python export.py --include saved_model pb tflite tfjs` (https://github.com/ultralytics/yolov5/pull/1127 by zldrobit)
- **OpenCV DNN**: YOLOv5 ONNX models are now compatible with both OpenCV DNN and ONNX Runtime (https://github.com/ultralytics/yolov5/pull/4833 by SamFC10).
- **Model Architecture:** Updated backbones are slightly smaller, faster and more accurate.
- Replacement of `Focus()` with an equivalent `Conv(k=6, s=2, p=2)` layer (https://github.com/ultralytics/yolov5/issues/4825 by thomasbi1) for improved exportability
- New `SPPF()` replacement for `SPP()` layer for reduced ops (https://github.com/ultralytics/yolov5/pull/4420 by glenn-jocher)
- Reduction in P3 backbone layer `C3()` repeats from 9 to 6 for improved speeds
- Reorder places `SPPF()` at end of backbone
- Reintroduction of shortcut in the last `C3()` backbone layer
- Updated [hyperparameters](https://github.com/ultralytics/yolov5/blob/master/data/hyps/hyp.scratch-high.yaml) with increased mixup and copy-paste augmentation
New Results
<p align="left"><img width="800" src="https://user-images.githubusercontent.com/26833433/136901921-abcfcd9d-f978-4942-9b97-0e3f202907df.png"></p>
<details>
<summary>YOLOv5-P5 640 Figure (click to expand)</summary>
<p align="left"><img width="800" src="https://user-images.githubusercontent.com/26833433/136763877-b174052b-c12f-48d2-8bc4-545e3853398e.png"></p>
</details>
<details>
<summary>Figure Notes (click to expand)</summary>
* **COCO AP val** denotes mAP0.5:0.95 metric measured on the 5000-image [COCO val2017](http://cocodataset.org) dataset over various inference sizes from 256 to 1536.
* **GPU Speed** measures average inference time per image on [COCO val2017](http://cocodataset.org) dataset using a [AWS p3.2xlarge](https://aws.amazon.com/ec2/instance-types/p3/) V100 instance at batch-size 32.
* **EfficientDet** data from [google/automl](https://github.com/google/automl) at batch size 8.
* **Reproduce** by `python val.py --task study --data coco.yaml --iou 0.7 --weights yolov5n6.pt yolov5s6.pt yolov5m6.pt yolov5l6.pt yolov5x6.pt`
</details>
mAP improves from +0.3% to +1.1% across all models, and ~5% FLOPs reduction produces slight speed improvements and a reduced CUDA memory footprint. Example YOLOv5l before and after metrics:
|YOLOv5l<br><sup>Large|size<br><sup>(pixels) |mAP<sup>val<br>0.5:0.95 |mAP<sup>val<br>0.5 |Speed<br><sup>CPU b1<br>(ms) |Speed<br><sup>V100 b1<br>(ms) |Speed<br><sup>V100 b32<br>(ms) |params<br><sup>(M) |FLOPs<br><sup>640 (B)
--- |--- |--- |--- |--- |--- |--- |--- |---