Git Product home page Git Product logo

yolov3_pytorch's Introduction

YOLOv3

Full implementation of YOLOv3 in PyTorch.

Overview

YOLOv3: An Incremental Improvement

[Paper]
[Original Implementation]

Why this project

  • Implement YOLOv3 and darknet53 without original darknet cfg parser.
  • It is easy to custom your backbone network. Such as resnet, densenet...
  • It is easy to reproduce result of paper using default parameters(~10 epochs).

Installation

Environment
  • pytorch >= 0.4.0
  • python >= 3.6.0
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. (keep default to reproduce the results of paper after 10 epochs)
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   

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 yolov3_weights_pytorch.pth to wegihts folder in this project.
Start evaluate
cd evaluate
python eval.py params.py
Results
Model mAP (min. 50 IoU) weights file
YOLOv3 (paper) 57.9
YOLOv3 (convert from paper) 58.18 official_yolov3_weights_pytorch.pth
YOLOv3 (our train 20 epochs) 59.66 yolov3_weights_pytorch.pth
YOLOv3 (our train 60 epochs) 61.89

Quick test

pretrained weights

Please download pretrained weights 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.

Measure FPS

pretrained weights

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

Start test
cd test
python test_fps.py params.py
Results
  • Test in TitanX GPU with different input size and batch size.
  • Keep in mind this is a full test in YOLOv3. Not only backbone but also yolo layer and NMS.
Imp. Backbone Input Size Batch Size Inference Time FPS
Paper Darknet53 320 1 22ms 45
Paper Darknet53 416 1 29ms 34
Paper Darknet53 608 1 51ms 19
Our Darknet53 416 1 28ms 36
Our Darknet53 416 8 17ms 58

Credit

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

Reference

yolov3_pytorch's People

Contributors

bobliu20 avatar jacke121 avatar

Stargazers

 avatar Jiahai avatar Hossein Kashiani avatar Syncdev avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.