Search for a command to run...
This release implements <strong>YOLOv5-P6</strong> models and retrained <strong>YOLOv5-P5</strong> models: <strong>YOLOv5-P5</strong> models (same architecture as v4.0 release): 3 output layers P3, P4, P5 at strides 8, 16, 32, trained at <code>--img 640</code> <strong>YOLOv5-P6</strong> models: <strong>4 output layers</strong> P3, P4, P5, P6 at strides 8, 16, 32, 64 trained at <code>--img 1280</code> Example usage: <pre><code class="lang-bash"># Command Line python detect.py --weights yolov5m.pt --img 640 # P5 model at 640 python detect.py --weights yolov5m6.pt --img 640 # P6 model at 640 python detect.py --weights yolov5m6.pt --img 1280 # P6 model at 1280 </code></pre> <pre><code class="lang-python"># PyTorch Hub model = torch.hub.load('ultralytics/yolov5', 'yolov5m6') # P6 model results = model(imgs, size=1280) # inference at 1280 </code></pre> All model sizes YOLOv5s/m/l/x are now available in P5 and P6 architectures: <pre><code class="lang-bash">python detect.py --weights yolov5s.pt # P5 models yolov5m.pt yolov5l.pt yolov5x.pt yolov5s6.pt # P6 models yolov5m6.pt yolov5l6.pt yolov5x6.pt </code></pre> Notable Updates <strong>YouTube Inference</strong>: Direct inference from YouTube videos, i.e. <code>python detect.py --source 'https://youtu.be/NUsoVlDFqZg'</code>. Live streaming videos and normal videos supported. (https://github.com/ultralytics/yolov5/pull/2752) <strong>AWS Integration</strong>: Amazon AWS integration and new AWS Quickstart Guide for simple EC2 instance YOLOv5 training and resuming of interrupted Spot instances. (https://github.com/ultralytics/yolov5/pull/2185) <strong>Supervise.ly Integration</strong>: New integration with the Supervisely Ecosystem for training and deploying YOLOv5 models with Supervise.ly (https://github.com/ultralytics/yolov5/issues/2518) <strong>Improved W&B Integration:</strong> Allows saving datasets and models directly to Weights & Biases. This allows for --resume directly from W&B (useful for temporary environments like Colab), as well as enhanced visualization tools. See this blog by @AyushExel for details. (https://github.com/ultralytics/yolov5/pull/2125) Updated Results P6 models include an extra P6/64 output layer for detection of larger objects, and benefit the most from training at higher resolution. For this reason we trained all P5 models at 640, and all P6 models at 1280. <p align="center"><img width="800" src="https://user-images.githubusercontent.com/26833433/114313216-f0a5e100-9af5-11eb-8445-c682b60da2e3.png"></p> <details> <summary>YOLOv5-P5 640 Figure (click to expand)</summary> <p align="center"><img width="800" src="https://user-images.githubusercontent.com/26833433/114313219-f1d70e00-9af5-11eb-9973-52b1f98d321a.png"></p> </details> <details> <summary>Figure Notes (click to expand)</summary> * GPU Speed measures end-to-end time per image averaged over 5000 COCO val2017 images using a V100 GPU with batch size 32, and includes image preprocessing, PyTorch FP16 inference, postprocessing and NMS. * EfficientDet data from [google/automl](https://github.com/google/automl) at batch size 8. </details> <strong>April 11, 2021</strong>: v5.0 release: YOLOv5-P6 1280 models, AWS, Supervise.ly and YouTube integrations. <strong>January 5, 2021</strong>: v4.0 release: nn.SiLU() activations, Weights & Biases logging, PyTorch Hub integration. <strong>August 13, 2020</strong>: v3.0 release: nn.Hardswish() activations, data autodownload, native AMP. <strong>July 23, 2020</strong>: v2.0 release: improved model definition, training and mAP. Pretrained Checkpoints Model size<br><sup>(pixels) mAP<sup>val<br>0.5:0.95 mAP<sup>test<br>0.5:0.95 mAP<sup>val<br>0.5 Speed<br><sup>V100 (ms) params<br><sup>(M) FLOPS<br><sup>640 (B) YOLOv5s 640 36.7 36.7 55.4 <strong>2.0</strong> 7.3 17.0 YOLOv5m 640 44.5 44.5 63.3 2.7 21.4 51.3 YOLOv5l 640 48.2 48.2 66.9 3.8 47.0 115.4 YOLOv5x 640 <strong>50.4</strong> <strong>50.4</strong> <strong>68.8</strong> 6.1 87.7 218.8 YOLOv5s6 1280 43.3 43.3 61.9 <strong>4.3</strong> 12.7 17.4 YOLOv5m6 1280 50.5 50.5 68.7 8.4 35.9 52.4 YOLOv5l6 1280 53.4 53.4 71.1 12.3 77.2 117.7 YOLOv5x6 1280 <strong>54.4</strong> <strong>54.4</strong> <strong>72.0</strong> 22.4 141.8 222.9 YOLOv5x6 TTA 1280 <strong>55.0</strong> <strong>55.0</strong> <strong>72.0</strong> 70.8 - - <details> <summary>Table Notes (click to expand)</summary> * AP<sup>test</sup> denotes COCO [test-dev2017](http://cocodataset.org/#upload) server results, all other AP results denote val2017 accuracy. * AP values are for single-model single-scale unless otherwise noted. **Reproduce mAP** by `python test.py --data coco.yaml --img 640 --conf 0.001 --iou 0.65` * Speed<sub>GPU</sub> averaged over 5000 COCO val2017 images using a GCP [n1-standard-16](https://cloud.google.com/compute/docs/machine-types#n1_standard_machine_types) V100 instance, and includes FP16 inference, postprocessing and NMS. **Reproduce speed** by `python test.py --data coco.yaml --img 640 --conf 0.25 --iou 0.45` * All checkpoints are trained to 300 epochs with default settings and hyperparameters (no autoaugmentation). * Test Time Augmentation ([TTA](https://github.com/ultralytics/yolov5/issues/303)) includes reflection and scale augmentation. **Reproduce TTA** by `python test.py --data coco.yaml --img 1536 --iou 0.7 --augment` </details>Changelog Changes between <strong>previous release and this release</strong>: https://github.com/ultralytics/yolov5/compare/v4.0...v5.0 Changes <strong>since this release</strong>: https://github.com/ultralytics/yolov5/compare/v5.0...HEAD <strong>Click a section</strong> below to <strong>expand details</strong>: <details> <summary>Implemented Enhancements (26) </summary> - Return predictions as json [\#2703](https://github.com/ultralytics/yolov5/issues/2703) - Single channel image training? [\#2609](https://github.com/ultralytics/yolov5/issues/2609) - Images in MPO Format are considered corrupted [\#2446](https://github.com/ultralytics/yolov5/issues/2446) - Improve Validation Visualization [\#2384](https://github.com/ultralytics/yolov5/issues/2384) - Add ASFF \(three fuse feature layers\) int the Head for V5\(s,m,l,x\) [\#2348](https://github.com/ultralytics/yolov5/issues/2348) - Dear author, can you provide a visualization scheme for YOLOV5 feature graphs during detect.py? Thank you! [\#2259](https://github.com/ultralytics/yolov5/issues/2259) - Dataloader [\#2201](https://github.com/ultralytics/yolov5/issues/2201) - Update Train Custom Data wiki page [\#2187](https://github.com/ultralytics/yolov5/issues/2187) - Multi-class NMS [\#2162](https://github.com/ultralytics/yolov5/issues/2162) - 💡Idea: Mosaic cropping using segmentation labels [\#2151](https://github.com/ultralytics/yolov5/issues/2151) - Improving Confusion Matrix Interpretability: FP and FN vectors should be switched to align with Predicted and True axis [\#2071](https://github.com/ultralytics/yolov5/issues/2071) - Interpreting model YoloV5 by Grad-cam [\#2065](https://github.com/ultralytics/yolov5/issues/2065) - Output optimal confidence threshold based on PR curve [\#2048](https://github.com/ultralytics/yolov5/issues/2048) - is it valuable that add --cache-images option to detect.py? [\#2004](https://github.com/ultralytics/yolov5/issues/2004) - I want to change the anchor box to anchor circles, where do you think the change to be made ? [\#1987](https://github.com/ultralytics/yolov5/issues/1987) - Support for imgaug [\#1954](https://github.com/ultralytics/yolov5/issues/1954) - Any plan for Knowledge Distillation? [\#1762](https://github.com/ultralytics/yolov5/issues/1762) - Is there a wasy to run detections on a video/webcam/rtrsp, etc EVERY x SECONDS? [\#1742](https://github.com/ultralytics/yolov5/issues/1742) - Can yolov5 support rotated target detection? [\#1728](https://github.com/ultralytics/yolov5/issues/1728) - Deploying yolov5 to TorchServe \(GPU compatible\) [\#1681](https://github.com/ultralytics/yolov5/issues/1681) - Why diffrent colors of bboxs? [\#1638](https://github.com/ultralytics/yolov5/issues/1638) - Yet another export yolov5 models to ONNX and inference with TensorRT [\#1597](https://github.com/ultralytics/yolov5/issues/1597) - Rerange the blocks of Focus Layer into `row major` to be compatible with tensorflow `SpaceToDepth` [\#413](https://github.com/ultralytics/yolov5/issues/413) - YouTube Livestream Detection [\#2752](https://github.com/ultralytics/yolov5/pull/2752) ([ben-milanko](https://github.com/ben-milanko)) - Add TransformerLayer, TransformerBlock, C3TR modules [\#2333](https://github.com/ultralytics/yolov5/pull/2333) ([dingyiwei](https://github.com/dingyiwei)) - Improved W&B integration [\#2125](https://github.com/ultralytics/yolov5/pull/2125) ([AyushExel](https://github.com/AyushExel)) </details><details> <summary>Fixed Bugs (73)</summary> - it seems that check\_wandb\_resume don't support multiple input files of images. [\#2716](https://github.com/ultralytics/yolov5/issues/2716) - ip camera or web camera. error: \(-215:Assertion failed\) !ss ize.empty\(\) in function 'cv::resize' [\#2709](https://github.com/ultralytics/yolov5/issues/2709) - Model predict with forward will fail if PIL image does not have filename attribute [\#2702](https://github.com/ultralytics/yolov5/issues/2702) - ❔Question Whenever i try to run my model i run into this error AttributeError: 'NoneType' object has no attribute 'startswith' from wandbutils.py line 161 I wonder why ? Any workaround or fix [\#2697](https://github.com/ultralytics/yolov5/issues/2697) - coremltools no longer included in docker container [\#2686](https://github.com/ultralytics/yolov5/issues/2686) - 'LoadImages' path handling appears to be broken [\#2618](https://github.com/ultralytics/