«YOLOv3» reproduced the paper "YOLOv3: An Incremental Improvement"
- Train using the
COCO train2017
dataset and test using theCOCO val2017
dataset with an input size of416x416
. give the result as follows (No version of the COCO dataset used in the paper was found)
Original (darknet) | DeNA/PyTorch_YOLOv3 | zjykzj/YOLOv3(This) | |
---|---|---|---|
ARCH | YOLOv3 | YOLOv3 | YOLOv3 |
COCO AP[IoU=0.50:0.95] | 0.310 | 0.311 | 0.314(v4.0)/0.315(v2.0) |
COCO AP[IoU=0.50] | 0.553 | 0.558 | 0.535(v4.0)/0.543(v2.0) |
- Table of Contents
- Latest News
- Background
- Prepare Data
- Installation
- Usage
- Maintainers
- Thanks
- Contributing
- License
- [2023/07/19]v4.0. Add ultralytics/yolov5(485da42) transforms and support AMP training.
- [2023/06/22]v3.2. Remove Excess Code and Implementation.
- [2023/06/22]v3.1. Reconstruct DATA Module and Preprocessing Module.
- [2023/05/24]v3.0. Refer to zjykzj/YOLOv2 to reconstruct the entire project and train
Pascal VOC
andCOCO
datasets withYOLOv2Loss
. - [2023/04/16]v2.0. Fixed preprocessing implementation, YOLOv3 network performance close to the original paper implementation.
- [2023/02/16]v1.0. implementing preliminary YOLOv3 network training and inference implementation.
The purpose of creating this warehouse is to better understand the YOLO series object detection network. Note: The realization of the project depends heavily on the implementation of DeNA/PyTorch_YOLOv3 and NVIDIA/apex
Use this script voc2yolov5.py
python voc2yolov5.py -s /home/zj/data/voc -d /home/zj/data/voc/voc2yolov5-train -l trainval-2007 trainval-2012
python voc2yolov5.py -s /home/zj/data/voc -d /home/zj/data/voc/voc2yolov5-val -l test-2007
Then softlink the folder where the dataset is located to the specified location:
ln -s /path/to/voc /path/to/YOLOv3/../datasets/voc
Use this script get_coco.sh
Refer to requirements.txt for installing the training environment
pip install -r requirements.txt
Development environment (Use nvidia docker container)
docker run --gpus all -it --rm -v </path/to/YOLOv3>:/app/YOLOv3 -v </path/to/COCO>:/app/YOLOv3/COCO nvcr.io/nvidia/pytorch:22.08-py3
- One GPU
CUDA_VISIBLE_DEVICES=0 python main_amp.py -c configs/yolov3_coco.cfg --opt-level=O1 ../datasets/coco
- Multi-GPUs
CUDA_VISIBLE_DEVICES=0,1,2,3 python -m torch.distributed.launch --nproc_per_node=4 --master_port "36321" main_amp.py -c configs/yolov3_coco.cfg --opt-level=O1 ../datasets/coco
python eval.py -c configs/yolov3_coco.cfg -ckpt outputs/yolov3_coco/model_best.pth.tar ../datasets/coco
Average Precision (AP) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = 0.314
Average Precision (AP) @[ IoU=0.50 | area= all | maxDets=100 ] = 0.535
Average Precision (AP) @[ IoU=0.75 | area= all | maxDets=100 ] = 0.323
Average Precision (AP) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.133
Average Precision (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.342
Average Precision (AP) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.467
Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 1 ] = 0.272
Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 10 ] = 0.413
Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = 0.436
Average Recall (AR) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.252
Average Recall (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.473
Average Recall (AR) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.594
python eval.py -c configs/yolov3_voc.cfg -ckpt outputs/yolov3_voc/model_best.pth.tar ../datasets/voc
VOC07 metric? Yes
AP for aeroplane = 0.8442
AP for bicycle = 0.8575
AP for bird = 0.7730
AP for boat = 0.6824
AP for bottle = 0.6737
AP for bus = 0.8505
AP for car = 0.8663
AP for cat = 0.8667
AP for chair = 0.6073
AP for cow = 0.8196
AP for diningtable = 0.7213
AP for dog = 0.8433
AP for horse = 0.8761
AP for motorbike = 0.8568
AP for person = 0.8245
AP for pottedplant = 0.5211
AP for sheep = 0.8140
AP for sofa = 0.7385
AP for train = 0.8304
AP for tvmonitor = 0.7727
Mean AP = 0.7820
python demo.py -c 0.6 configs/yolov3_coco.cfg outputs/yolov3_coco/model_best.pth.tar --exp coco assets/coco/
python demo.py -c 0.6 configs/yolov3_voc.cfg outputs/yolov3_voc/model_best.pth.tar --exp voc assets/voc2007-test/
- zhujian - Initial work - zjykzj
Anyone's participation is welcome! Open an issue or submit PRs.
Small note:
- Git submission specifications should be complied with Conventional Commits
- If versioned, please conform to the Semantic Versioning 2.0.0 specification
- If editing the README, please conform to the standard-readme specification.
Apache License 2.0 © 2022 zjykzj