Home

Awesome

YOLOv3

Full implementation of YOLOv3 in PyTorch.

Overview

YOLOv3: An Incremental Improvement

[Paper]
[Original Implementation]

Why this project

Installation

Environment
Get code
git clone https://github.com/BobLiu20/YOLOv3_PyTorch.git
cd YOLOv3_PyTorch
pip3 install -r requirements.txt --user
Download COCO dataset
cd data/
bash get_coco_dataset.sh

Training

Download pretrained weights
  1. See weights readme for detail.
  2. Download pretrained backbone wegiths from Google Drive or Baidu Drive
  3. Move downloaded file darknet53_weights_pytorch.pth to wegihts folder in this project.
Modify training parameters
  1. Review config file training/params.py
  2. Replace YOUR_WORKING_DIR to your working directory. Use for save model and tmp file.
  3. Adjust your GPU device. see parallels.
  4. Adjust other parameters.
Start training
cd training
python training.py params.py
Option: Visualizing training
#  please install tensorboard in first
python -m tensorboard.main --logdir=YOUR_WORKING_DIR   
<p><img src="common/demo/loss_curve.png"\></p>

Evaluate

Download pretrained weights
  1. See weights readme for detail.
  2. Download pretrained yolo3 full wegiths from Google Drive or Baidu Drive
  3. Move downloaded file official_yolov3_weights_pytorch.pth to wegihts folder in this project.
Start evaluate
cd evaluate
python eval_coco.py params.py

Quick test

pretrained weights

Please download pretrained weights official_yolov3_weights_pytorch.pth or use yourself checkpoint.

Start test
cd test
python test_images.py params.py

You can got result images in output folder.

<p align="center"><img src="common/demo/demo0.jpg"\></p> <p align="center"><img src="common/demo/demo1.jpg"\></p>

Measure FPS

pretrained weights

Please download pretrained weights official_yolov3_weights_pytorch.pth or use yourself checkpoint.

Start test
cd test
python test_fps.py params.py
Results
Imp.BackboneInput SizeBatch SizeInference TimeFPS
PaperDarknet53320122ms45
PaperDarknet53416129ms34
PaperDarknet53608151ms19
OurDarknet53416128ms36
OurDarknet53416817ms58

Credit

@article{yolov3,
	title={YOLOv3: An Incremental Improvement},
	author={Redmon, Joseph and Farhadi, Ali},
	journal = {arXiv},
	year={2018}
}

Reference