|
|
@@ -62,15 +62,14 @@ See the [YOLOv5 Docs](https://docs.ultralytics.com) for full documentation on tr |
|
|
|
<details open> |
|
|
|
<summary>Install</summary> |
|
|
|
|
|
|
|
[**Python>=3.6.0**](https://www.python.org/) is required with all |
|
|
|
[requirements.txt](https://github.com/ultralytics/yolov5/blob/master/requirements.txt) installed including |
|
|
|
[**PyTorch>=1.7**](https://pytorch.org/get-started/locally/): |
|
|
|
<!-- $ sudo apt update && apt install -y libgl1-mesa-glx libsm6 libxext6 libxrender-dev --> |
|
|
|
Clone repo and install [requirements.txt](https://github.com/ultralytics/yolov5/blob/master/requirements.txt) in a |
|
|
|
[**Python>=3.6.0**](https://www.python.org/) environment, including |
|
|
|
[**PyTorch>=1.7**](https://pytorch.org/get-started/locally/). |
|
|
|
|
|
|
|
```bash |
|
|
|
$ git clone https://github.com/ultralytics/yolov5 |
|
|
|
$ cd yolov5 |
|
|
|
$ pip install -r requirements.txt |
|
|
|
git clone https://github.com/ultralytics/yolov5 # clone |
|
|
|
cd yolov5 |
|
|
|
pip install -r requirements.txt # install |
|
|
|
``` |
|
|
|
|
|
|
|
</details> |
|
|
@@ -78,8 +77,9 @@ $ pip install -r requirements.txt |
|
|
|
<details open> |
|
|
|
<summary>Inference</summary> |
|
|
|
|
|
|
|
Inference with YOLOv5 and [PyTorch Hub](https://github.com/ultralytics/yolov5/issues/36). Models automatically download |
|
|
|
from the [latest YOLOv5 release](https://github.com/ultralytics/yolov5/releases). |
|
|
|
Inference with YOLOv5 and [PyTorch Hub](https://github.com/ultralytics/yolov5/issues/36) |
|
|
|
. [Models](https://github.com/ultralytics/yolov5/tree/master/models) download automatically from the latest |
|
|
|
YOLOv5 [release](https://github.com/ultralytics/yolov5/releases). |
|
|
|
|
|
|
|
```python |
|
|
|
import torch |
|
|
@@ -104,17 +104,17 @@ results.print() # or .show(), .save(), .crop(), .pandas(), etc. |
|
|
|
<details> |
|
|
|
<summary>Inference with detect.py</summary> |
|
|
|
|
|
|
|
`detect.py` runs inference on a variety of sources, downloading models automatically from |
|
|
|
the [latest YOLOv5 release](https://github.com/ultralytics/yolov5/releases) and saving results to `runs/detect`. |
|
|
|
`detect.py` runs inference on a variety of sources, downloading [models](https://github.com/ultralytics/yolov5/tree/master/models) automatically from |
|
|
|
the latest YOLOv5 [release](https://github.com/ultralytics/yolov5/releases) and saving results to `runs/detect`. |
|
|
|
|
|
|
|
```bash |
|
|
|
$ python detect.py --source 0 # webcam |
|
|
|
img.jpg # image |
|
|
|
vid.mp4 # video |
|
|
|
path/ # directory |
|
|
|
path/*.jpg # glob |
|
|
|
'https://youtu.be/Zgi9g1ksQHc' # YouTube |
|
|
|
'rtsp://example.com/media.mp4' # RTSP, RTMP, HTTP stream |
|
|
|
python detect.py --source 0 # webcam |
|
|
|
img.jpg # image |
|
|
|
vid.mp4 # video |
|
|
|
path/ # directory |
|
|
|
path/*.jpg # glob |
|
|
|
'https://youtu.be/Zgi9g1ksQHc' # YouTube |
|
|
|
'rtsp://example.com/media.mp4' # RTSP, RTMP, HTTP stream |
|
|
|
``` |
|
|
|
|
|
|
|
</details> |
|
|
@@ -122,16 +122,20 @@ $ python detect.py --source 0 # webcam |
|
|
|
<details> |
|
|
|
<summary>Training</summary> |
|
|
|
|
|
|
|
Run commands below to reproduce results |
|
|
|
on [COCO](https://github.com/ultralytics/yolov5/blob/master/data/scripts/get_coco.sh) dataset (dataset auto-downloads on |
|
|
|
first use). Training times for YOLOv5s/m/l/x are 2/4/6/8 days on a single V100 (multi-GPU times faster). Use the |
|
|
|
largest `--batch-size` your GPU allows (batch sizes shown for 16 GB devices). |
|
|
|
The commands below reproduce YOLOv5 [COCO](https://github.com/ultralytics/yolov5/blob/master/data/scripts/get_coco.sh) |
|
|
|
results. [Models](https://github.com/ultralytics/yolov5/tree/master/models) |
|
|
|
and [datasets](https://github.com/ultralytics/yolov5/tree/master/data) download automatically from the latest |
|
|
|
YOLOv5 [release](https://github.com/ultralytics/yolov5/releases). Training times for YOLOv5n/s/m/l/x are |
|
|
|
1/2/4/6/8 days on a V100 GPU ([Multi-GPU](https://github.com/ultralytics/yolov5/issues/475) times faster). Use the |
|
|
|
largest `--batch-size` possible, or pass `--batch-size -1` for |
|
|
|
YOLOv5 [AutoBatch](https://github.com/ultralytics/yolov5/pull/5092). Batch sizes shown for V100-16GB. |
|
|
|
|
|
|
|
```bash |
|
|
|
$ python train.py --data coco.yaml --cfg yolov5s.yaml --weights '' --batch-size 64 |
|
|
|
yolov5m 40 |
|
|
|
yolov5l 24 |
|
|
|
yolov5x 16 |
|
|
|
python train.py --data coco.yaml --cfg yolov5n.yaml --weights '' --batch-size 128 |
|
|
|
yolov5s 64 |
|
|
|
yolov5m 40 |
|
|
|
yolov5l 24 |
|
|
|
yolov5x 16 |
|
|
|
``` |
|
|
|
|
|
|
|
<img width="800" src="https://user-images.githubusercontent.com/26833433/90222759-949d8800-ddc1-11ea-9fa1-1c97eed2b963.png"> |
|
|
@@ -225,6 +229,7 @@ We are super excited about our first-ever Ultralytics YOLOv5 🚀 EXPORT Competi |
|
|
|
### Pretrained Checkpoints |
|
|
|
|
|
|
|
[assets]: https://github.com/ultralytics/yolov5/releases |
|
|
|
|
|
|
|
[TTA]: https://github.com/ultralytics/yolov5/issues/303 |
|
|
|
|
|
|
|
|Model |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) |
|
|
@@ -257,7 +262,6 @@ We love your input! We want to make contributing to YOLOv5 as easy and transpare |
|
|
|
|
|
|
|
<a href="https://github.com/ultralytics/yolov5/graphs/contributors"><img src="https://opencollective.com/ultralytics/contributors.svg?width=990" /></a> |
|
|
|
|
|
|
|
|
|
|
|
## <div align="center">Contact</div> |
|
|
|
|
|
|
|
For YOLOv5 bugs and feature requests please visit [GitHub Issues](https://github.com/ultralytics/yolov5/issues). For business inquiries or |