|
|
il y a 2 ans | |
|---|---|---|
| config | il y a 2 ans | |
| dataset | il y a 2 ans | |
| evaluator | il y a 2 ans | |
| img_files | il y a 2 ans | |
| models | il y a 2 ans | |
| tools | il y a 2 ans | |
| utils | il y a 2 ans | |
| .gitignore | il y a 2 ans | |
| LICENSE | il y a 2 ans | |
| README.md | il y a 2 ans | |
| README_CN.md | il y a 2 ans | |
| demo.py | il y a 2 ans | |
| engine.py | il y a 2 ans | |
| eval.py | il y a 2 ans | |
| requirements.txt | il y a 2 ans | |
| test.py | il y a 2 ans | |
| track.py | il y a 2 ans | |
| train.py | il y a 2 ans | |
| train.sh | il y a 2 ans | |
| train_ddp.sh | il y a 2 ans |
YOLO Tutorial
English | 简体中文
Here is the source code for an introduction to YOLO. We adopted the core concepts of YOLOv1~v4, YOLOX and YOLOv7 for this project and made the necessary adjustments. By learning how to construct the well-known YOLO detector, we hope that newcomers can enter the field of object detection without any difficulty.
Book: The technical books that go along with this project's code is being reviewed, please be patient.
We recommend you to use Anaconda to create a conda environment:
conda create -n yolo python=3.6
Then, activate the environment:
conda activate yolo
Requirements:
pip install -r requirements.txt
My environment:
At least, please make sure your torch is version 1.x.
| Configuration | |
|---|---|
| Per GPU Batch Size | 16 |
| Init Lr | 0.01 |
| Warmup Scheduler | Linear |
| Lr Scheduler | Linear |
| Optimizer | SGD |
| Multi Scale Train | True (320 ~ 640) |
Due to my limited computing resources, I can not use a larger multi-scale range, such as 320-960.
Download VOC.
cd <PyTorch_YOLO_Tutorial>
cd dataset/scripts/
sh VOC2007.sh
sh VOC2012.sh
Check VOC
cd <PyTorch_YOLO_Tutorial>
python dataset/voc.py
Train on VOC
For example:
python train.py --cuda -d voc --root path/to/VOCdevkit -m yolov1 -bs 16 --max_epoch 150 --wp_epoch 1 --eval_epoch 10 --fp16 --ema --multi_scale
| Model | Backbone | Scale | IP | Epoch | APval 0.5 | FPS3090 FP32-bs1 | Weight | |
|---|---|---|---|---|---|---|---|---|
| YOLOv1 | ResNet-18 | 640 | √ | 150 | 76.7 | ckpt | ||
| YOLOv2 | DarkNet-19 | 640 | √ | 150 | 79.8 | ckpt | ||
| YOLOv3 | DarkNet-53 | 640 | √ | 150 | 82.0 | ckpt | ||
| YOLOv4 | CSPDarkNet-53 | 640 | √ | 150 | 83.6 | ckpt | ||
| YOLOX-L | CSPDarkNet-L | 640 | √ | 150 | 84.6 | ckpt | ||
| YOLOv7-Large | ELANNet-Large | 640 | √ | 150 | 86.0 | ckpt |
| Model | Backbone | Scale | Epoch | APval 0.5:0.95 | APval 0.5 | FLOPs (G) | Params (M) | Weight |
|---|---|---|---|---|---|---|---|---|
| YOLOv1 | ResNet-18 | 640 | 150 | 27.9 | 47.5 | 37.8 | 21.3 | ckpt |
| YOLOv2 | DarkNet-19 | 640 | 150 | 32.7 | 50.9 | 53.9 | 30.9 | ckpt |
| Model | Backbone | Scale | Epoch | APval 0.5:0.95 | APval 0.5 | FLOPs (G) | Params (M) | Weight |
|---|---|---|---|---|---|---|---|---|
| YOLOv3-Tiny | DarkNet-Tiny | 640 | 250 | 25.4 | 43.4 | 7.0 | 2.3 | ckpt |
| YOLOv3 | DarkNet-53 | 640 | 250 | 42.9 | 63.5 | 167.4 | 54.9 | ckpt |
| Model | Backbone | Scale | Epoch | APval 0.5:0.95 | APval 0.5 | FLOPs (G) | Params (M) | Weight |
|---|---|---|---|---|---|---|---|---|
| YOLOv4-Tiny | CSPDarkNet-Tiny | 640 | 250 | 31.0 | 49.1 | 8.1 | 2.9 | ckpt |
| YOLOv4 | CSPDarkNet-53 | 640 | 250 | 46.6 | 65.8 | 162.7 | 61.5 | ckpt |
| Model | Backbone | Scale | Epoch | APval 0.5:0.95 | APval 0.5 | FLOPs (G) | Params (M) | Weight |
|---|---|---|---|---|---|---|---|---|
| YOLOv5-N | CSPDarkNet-N | 640 | 250 | 29.8 | 47.1 | 7.7 | 2.4 | ckpt |
| YOLOv5-S | CSPDarkNet-S | 640 | 250 | 37.8 | 56.5 | 27.1 | 9.0 | ckpt |
| YOLOv5-M | CSPDarkNet-M | 640 | 250 | 43.5 | 62.5 | 74.3 | 25.4 | ckpt |
| YOLOv5-L | CSPDarkNet-L | 640 | 250 | 46.7 | 65.5 | 155.6 | 54.2 | ckpt |
| Model | Backbone | Scale | Epoch | APval 0.5:0.95 | APval 0.5 | FLOPs (G) | Params (M) | Weight |
|---|---|---|---|---|---|---|---|---|
| YOLOX-N | CSPDarkNet-N | 640 | 300 | 7.5 | 2.3 | |||
| YOLOX-S | CSPDarkNet-S | 640 | 300 | 27.1 | 9.0 | |||
| YOLOX-M | CSPDarkNet-M | 640 | 300 | 74.3 | 25.4 | |||
| YOLOX-L | CSPDarkNet-L | 640 | 300 | 155.4 | 54.2 |
| Model | Backbone | Scale | Epoch | APval 0.5:0.95 | APval 0.5 | FLOPs (G) | Params (M) | Weight |
|---|---|---|---|---|---|---|---|---|
| YOLOv7-T | ELANNet-Tiny | 640 | 300 | 38.0 | 56.8 | 22.6 | 7.9 | ckpt |
| YOLOv7-L | ELANNet-Large | 640 | 300 | 48.0 | 67.5 | 144.6 | 44.0 | ckpt |