Skip to content

This repo for enhacing the performance of yolov3

Notifications You must be signed in to change notification settings

buiduchanh/TF_yolov3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

START

This code is implemented base on the original code Yolov3 Tensorflow. The main purpose is improving the performance and can using on some Edge device

Clone this file

$ git clone https://github.com/buiduchanh/TF_yolov3.git

Train your own dataset

1. Prepare Dataset

Two files are required as follows:

xxx/xxx.jpg 18.19,6.32,424.13,421.83,20 323.86,2.65,640.0,421.94,20 
xxx/xxx.jpg 48,240,195,371,11 8,12,352,498,14
# image_path x_min, y_min, x_max, y_max, class_id  x_min, y_min ,..., class_id 
# make sure that x_max < width and y_max < height
person
bicycle
car
...
toothbrush

2. Caculate Anchor

We provided file kmeans.py for caculate the anchor like coco_anchor.txt

3. Change config

Then edit your ./core/config.py to make some necessary configurations

__C.YOLO.CLASSES                = "./data/classes/voc.names"
__C.TRAIN.ANNOT_PATH            = "./data/dataset/voc_train.txt"
__C.TEST.ANNOT_PATH             = "./data/dataset/voc_test.txt"

If you want to use MobileNetV2 as backbone instead of Darknet53 just set the parameters in config same as below
__C.YOLO.BACKBONE_MOBILE        = True
__C.YOLO.GT_PER_GRID            = 3

Here are two kinds of training method:

4. Training

$ python train.py
$ tensorboard --logdir ./data

Result

We will update this result asap

Improve from original code

  • MobileV2
  • DarkNet
  • Using Focal loss
  • Added Batch Normalize

TODO

  • Convert model to using in edge device
  • Adding channel prunning
  • Using Diou loss instead of Giou loss ( increase mAP ~5%)
  • Adaptively spatial feature fusion ASFF which increase the mAP ~ 10%

Reference

Stronger-Yolo
focal-loss
kl-loss
YOLOv3目标检测有了TensorFlow实现,可用自己的数据来训练
Implementing YOLO v3 in Tensorflow (TF-Slim)
Understanding YOLO

About

This repo for enhacing the performance of yolov3

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published