For better performance, this not the same as the original paper.
I achieved 0.684 mAP on VOC07test, 76fps on RTX2080Ti
For better training speed, I changed the backbone from vgg to resnet50. And add a few 1x1 and 3x3 conv to fine-tune the resnet. For better detection for small objects, I change the 7x7 feature maps to 14x14 feature maps and drop the fully connected which has been implemented in the original paper.
| model | map on VOC07test | FPS |
|---|---|---|
| YOLO Resnet50 | 68.4% | 76 |
| YOLO original | 63.4% | 45 |
- pytorch 1.2.0
- cuda 10.0.1
- pillow 6.2.1
- numpy
Download the file
git clone https://github.com/Kevinz-code/YOLOv1.git
python demo.pyAnd You will find the demo results pictures in
./demo/demo_results- Download VOC2012train and VOC2007train dataset
- Download VOC2007test dataset
- Put them in the dir
../Image/To train from scratch, run
python main.py -s 0 To get parameters help, run
python main.py -hThis will automatically start train on VOC07+12, and test on VOC07 every epochs.
Some parameters setting are very Important. And I spent a long time trying to find these best parameters. For convenience, I list them below.
For Training
| learning rate | 3e-3, 1e-3 |
|---|---|
| weight_decay | 0.0005 |
| miniBatch | 16 |
| epoch | 30 |
| momentum | 0.9 |
For Testing
| confidence_thresh | 0.3 |
|---|---|
| nms_thresh | 0.26 |

