Skip to content

Commit 1c747e2

Browse files
authored
Update Ultralytics YOLOv5 PyTorch Hub page (#330)
* Update ultralytics_yolov5.md Update Ultralytics YOLOv5 PyTorch Hub example to latest release 7.0 usage and results. * Update images * Update image width * Update summary. * Update ultralytics_yolov5.md add trust_repo=True to avoid warning * Review fixes
1 parent 12d8df1 commit 1c747e2

File tree

5 files changed

+42
-38
lines changed

5 files changed

+42
-38
lines changed

images/ultralytics_yolov5_img0.jpg

-60.7 KB
Loading

images/ultralytics_yolov5_img1.jpg

-226 KB
Binary file not shown.

images/ultralytics_yolov5_img1.png

245 KB
Loading

images/ultralytics_yolov5_img2.png

-120 KB
Loading

ultralytics_yolov5.md

Lines changed: 42 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -4,68 +4,61 @@ background-class: hub-background
44
body-class: hub
55
category: researchers
66
title: YOLOv5
7-
summary: YOLOv5 in PyTorch > ONNX > CoreML > TFLite
7+
summary: Ultralytics YOLOv5 🚀 for object detection, instance segmentation and image classification.
88
image: ultralytics_yolov5_img0.jpg
99
author: Ultralytics
1010
tags: [vision, scriptable]
1111
github-link: https://github.com/ultralytics/yolov5
1212
github-id: ultralytics/yolov5
13-
featured_image_1: ultralytics_yolov5_img1.jpg
13+
featured_image_1: ultralytics_yolov5_img1.png
1414
featured_image_2: ultralytics_yolov5_img2.png
1515
accelerator: cuda-optional
16-
demo-model-link: https://huggingface.co/spaces/pytorch/YOLOv5
16+
demo-model-link: https://hub.ultralytics.com/projects/DnIqQCdlI37oliWBAoQJ
1717
---
1818

1919
## Before You Start
2020

2121
Start from a **Python>=3.8** environment with **PyTorch>=1.7** installed. To install PyTorch see [https://pytorch.org/get-started/locally/](https://pytorch.org/get-started/locally/). To install YOLOv5 dependencies:
22+
2223
```bash
23-
pip install -qr https://raw.githubusercontent.com/ultralytics/yolov5/master/requirements.txt # install dependencies
24+
pip install -U ultralytics
2425
```
2526

26-
2727
## Model Description
2828

29-
<img width="800" alt="YOLOv5 Model Comparison" src="https://github.com/ultralytics/yolov5/releases/download/v1.0/model_comparison.png">
30-
&nbsp;
31-
32-
[YOLOv5](https://ultralytics.com/yolov5) 🚀 is a family of compound-scaled object detection models trained on the COCO dataset, and includes simple functionality for Test Time Augmentation (TTA), model ensembling, hyperparameter evolution, and export to ONNX, CoreML and TFLite.
29+
<img width="800" alt="YOLO Model Comparison" src="https://raw.githubusercontent.com/ultralytics/assets/main/yolov8/yolo-comparison-plots.png">
3330

34-
|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)
35-
|--- |--- |--- |--- |--- |--- |---|--- |---
36-
|[YOLOv5s6](https://github.com/ultralytics/yolov5/releases) |1280 |43.3 |43.3 |61.9 |**4.3** | |12.7 |17.4
37-
|[YOLOv5m6](https://github.com/ultralytics/yolov5/releases) |1280 |50.5 |50.5 |68.7 |8.4 | |35.9 |52.4
38-
|[YOLOv5l6](https://github.com/ultralytics/yolov5/releases) |1280 |53.4 |53.4 |71.1 |12.3 | |77.2 |117.7
39-
|[YOLOv5x6](https://github.com/ultralytics/yolov5/releases) |1280 |**54.4** |**54.4** |**72.0** |22.4 | |141.8 |222.9
40-
|[YOLOv5x6](https://github.com/ultralytics/yolov5/releases) TTA |1280 |**55.0** |**55.0** |**72.0** |70.8 | |- |-
31+
Ultralytics YOLOv5 🚀 is a cutting-edge, state-of-the-art (SOTA) model that builds upon the success of previous YOLO versions and introduces new features and improvements to further boost performance and flexibility. YOLOv5 is designed to be fast, accurate, and easy to use, making it an excellent choice for a wide range of object detection, instance segmentation and image classification tasks.
4132

42-
<details>
43-
<summary>Table Notes (click to expand)</summary>
44-
45-
* AP<sup>test</sup> denotes COCO [test-dev2017](http://cocodataset.org/#upload) server results, all other AP results denote val2017 accuracy.
46-
* 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`
47-
* 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`
48-
* All checkpoints are trained to 300 epochs with default settings and hyperparameters (no autoaugmentation).
49-
* 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`
50-
51-
</details>
33+
We hope that the resources here will help you get the most out of YOLOv5. Please browse the YOLOv5 [Docs](https://docs.ultralytics.com/yolov5) for details, raise an issue on [GitHub](https://github.com/ultralytics/yolov5/issues/new/choose) for support, and join our [Discord](https://discord.gg/n6cFeSPZdD) community for questions and discussions!
5234

53-
<p align="left"><img width="800" src="https://github.com/ultralytics/yolov5/releases/download/v1.0/model_plot.png"></p>
35+
| Model | size<br><sup>(pixels) | mAP<sup>val<br>50-95 | mAP<sup>val<br>50 | 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) |
36+
|-------------------------------------------------------------------------------------------------|-----------------------|----------------------|-------------------|------------------------------|-------------------------------|--------------------------------|--------------------|------------------------|
37+
| [YOLOv5n](https://github.com/ultralytics/yolov5/releases/download/v7.0/yolov5n.pt) | 640 | 28.0 | 45.7 | **45** | **6.3** | **0.6** | **1.9** | **4.5** |
38+
| [YOLOv5s](https://github.com/ultralytics/yolov5/releases/download/v7.0/yolov5s.pt) | 640 | 37.4 | 56.8 | 98 | 6.4 | 0.9 | 7.2 | 16.5 |
39+
| [YOLOv5m](https://github.com/ultralytics/yolov5/releases/download/v7.0/yolov5m.pt) | 640 | 45.4 | 64.1 | 224 | 8.2 | 1.7 | 21.2 | 49.0 |
40+
| [YOLOv5l](https://github.com/ultralytics/yolov5/releases/download/v7.0/yolov5l.pt) | 640 | 49.0 | 67.3 | 430 | 10.1 | 2.7 | 46.5 | 109.1 |
41+
| [YOLOv5x](https://github.com/ultralytics/yolov5/releases/download/v7.0/yolov5x.pt) | 640 | 50.7 | 68.9 | 766 | 12.1 | 4.8 | 86.7 | 205.7 |
42+
| | | | | | | | | |
43+
| [YOLOv5n6](https://github.com/ultralytics/yolov5/releases/download/v7.0/yolov5n6.pt) | 1280 | 36.0 | 54.4 | 153 | 8.1 | 2.1 | 3.2 | 4.6 |
44+
| [YOLOv5s6](https://github.com/ultralytics/yolov5/releases/download/v7.0/yolov5s6.pt) | 1280 | 44.8 | 63.7 | 385 | 8.2 | 3.6 | 12.6 | 16.8 |
45+
| [YOLOv5m6](https://github.com/ultralytics/yolov5/releases/download/v7.0/yolov5m6.pt) | 1280 | 51.3 | 69.3 | 887 | 11.1 | 6.8 | 35.7 | 50.0 |
46+
| [YOLOv5l6](https://github.com/ultralytics/yolov5/releases/download/v7.0/yolov5l6.pt) | 1280 | 53.7 | 71.3 | 1784 | 15.8 | 10.5 | 76.8 | 111.4 |
47+
| [YOLOv5x6](https://github.com/ultralytics/yolov5/releases/download/v7.0/yolov5x6.pt)<br>+ [TTA] | 1280<br>1536 | 55.0<br>**55.8** | 72.7<br>**72.7** | 3136<br>- | 26.2<br>- | 19.4<br>- | 140.7<br>- | 209.8<br>- |
5448

5549
<details>
56-
<summary>Figure Notes (click to expand)</summary>
50+
<summary>Table Notes</summary>
5751

58-
* 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.
59-
* EfficientDet data from [google/automl](https://github.com/google/automl) at batch size 8.
60-
* **Reproduce** by `python test.py --task study --data coco.yaml --iou 0.7 --weights yolov5s6.pt yolov5m6.pt yolov5l6.pt yolov5x6.pt`
52+
- All checkpoints are trained to 300 epochs with default settings. Nano and Small models use [hyp.scratch-low.yaml](https://github.com/ultralytics/yolov5/blob/master/data/hyps/hyp.scratch-low.yaml) hyps, all others use [hyp.scratch-high.yaml](https://github.com/ultralytics/yolov5/blob/master/data/hyps/hyp.scratch-high.yaml).
53+
- **mAP<sup>val</sup>** values are for single-model single-scale on [COCO val2017](http://cocodataset.org) dataset.<br>Reproduce by `python val.py --data coco.yaml --img 640 --conf 0.001 --iou 0.65`
54+
- **Speed** averaged over COCO val images using a [AWS p3.2xlarge](https://aws.amazon.com/ec2/instance-types/p3/) instance. NMS times (~1 ms/img) not included.<br>Reproduce by `python val.py --data coco.yaml --img 640 --task speed --batch 1`
55+
- **TTA** [Test Time Augmentation](https://docs.ultralytics.com/yolov5/tutorials/test_time_augmentation) includes reflection and scale augmentations.<br>Reproduce by `python val.py --data coco.yaml --img 1536 --iou 0.7 --augment`
6156

6257
</details>
6358

6459
## Load From PyTorch Hub
6560

66-
67-
This example loads a pretrained **YOLOv5s** model and passes an image for inference. YOLOv5 accepts **URL**, **Filename**, **PIL**, **OpenCV**, **Numpy** and **PyTorch** inputs, and returns detections in **torch**, **pandas**, and **JSON** output formats. See our [YOLOv5 PyTorch Hub Tutorial](https://github.com/ultralytics/yolov5/issues/36) for details.
68-
61+
This example loads a pretrained **YOLOv5s** model and passes an image for inference. YOLOv5 accepts **URL**, **Filename**, **PIL**, **OpenCV**, **Numpy** and **PyTorch** inputs, and returns detections in **torch**, **pandas**, and **JSON** output formats. See the [YOLOv5 PyTorch Hub Tutorial](https://docs.ultralytics.com/yolov5/tutorials/pytorch_hub_model_loading/) for details.
6962

7063
```python
7164
import torch
@@ -92,16 +85,27 @@ results.pandas().xyxy[0] # img1 predictions (pandas)
9285
# 3 986.00 304.00 1028.0 420.0 0.286865 27 tie
9386
```
9487

95-
9688
## Citation
9789

90+
If you use YOLOv5 or YOLOv5u in your research, please cite the Ultralytics YOLOv5 repository as follows:
91+
9892
[![DOI](https://zenodo.org/badge/264818686.svg)](https://zenodo.org/badge/latestdoi/264818686)
9993

94+
```bibtex
95+
@software{yolov5,
96+
title = {YOLOv5 by Ultralytics},
97+
author = {Glenn Jocher},
98+
year = {2020},
99+
version = {7.0},
100+
license = {AGPL-3.0},
101+
url = {https://github.com/ultralytics/yolov5},
102+
doi = {10.5281/zenodo.3908559},
103+
orcid = {0000-0001-5950-6979}
104+
}
105+
```
100106

101107
## Contact
102108

103-
104-
**Issues should be raised directly in https://github.com/ultralytics/yolov5.** For business inquiries or professional support requests please visit [https://ultralytics.com](https://ultralytics.com) or email Glenn Jocher at [[email protected]](mailto:[email protected]).
105-
109+
For YOLOv5 bug reports and feature requests please visit [GitHub Issues](https://github.com/ultralytics/yolov5/issues), and join our [Discord](https://discord.gg/n6cFeSPZdD) community for questions and discussions!
106110

107111
&nbsp;

0 commit comments

Comments
 (0)