Skip to content

Yolov3 with multi scale training, multi augmentation, full in Pytorch0.4 codes

License

Notifications You must be signed in to change notification settings

sztcmtj/Yolov3-in-Pytorch

 
 

Repository files navigation

This implementation is not 100% same with the original version !

The diffrence between this repo and the original YOLOv3:

  1. Using Resnet50 as detection backbone instead of Darknet53.
  2. Switch the individual binary classifier with softmax cross-entropy loss

Things that have been done:

  1. Full pytorch and numpy implementation of YOLOv3 training and detection
  2. Pytorch 0.4 codes
  3. Multi-Scale Training mentioned in the paper -> so far as I noticed, this one is not implemented by a lot of posts about yolo out there.
  4. lots of data augmentation,thanks to imgaug:
  5. training in coco2017 dataset

How to use

First, clone this repo by input:

git clone https://github.com/TreB1eN/Yolov3-in-Pytorch.git

Detection:

  1. Secondly, download the trained model from cloud drive into data/model folder

  2. For detection in single image, please run

python detect_on_image.py -f input_image_path -o output_image_path -l detection_level
  1. For detection in video, please run
python detect_on_video.py -f input_video_path -o output_video_path -l detection_level
  1. For detection in camera, please run
python detect_on_camera.py -l detection_level

Training:

  1. download train2017.zip, val2017.zip and annotations_trainval2017.zip from coco website to data/coco2017
  2.  unzip data/coco2017/train2017.zip
     unzip data/coco2017/val2017.zip
     unzip data/coco2017/annotations_trainval2017.zip
    
  3. run
    python train.py
    
    Details and parameters are in the codes

Evaluate on coco:

python eva_coco.py -l detection_level

Video Demo

Demo1 Youtube: , Youku: Demo2 Youtube: , Youku:

Detection Example

img img img

Performance:


Haven't done any hyperparameter tuning

 Average Precision  (AP) @[ IoU=0.50:0.95 | area=   all | maxDets=100 ] = 0.219
 Average Precision  (AP) @[ IoU=0.50      | area=   all | maxDets=100 ] = 0.400
 Average Precision  (AP) @[ IoU=0.75      | area=   all | maxDets=100 ] = 0.216
 Average Precision  (AP) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.088
 Average Precision  (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.233
 Average Precision  (AP) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.342
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets=  1 ] = 0.212
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets= 10 ] = 0.306
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets=100 ] = 0.314
 Average Recall     (AR) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.126
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.329
 Average Recall     (AR) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.475

Todo List:

  • Hyperparameters Tuning yet
  • Multi-GPU Support
  • trained with original Darknet53
  • try Binary Classifier instead of Softmax as discussed in the paper
  • try soft-nms

I dont't have much computing resource, PRs are welcomed !


YOLOv3: An Incremental Improvement


This repo is also inspired by marvis/pytorch-yolo2: and qqwweee/keras-yolo3:

About

Yolov3 with multi scale training, multi augmentation, full in Pytorch0.4 codes

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%