Performance(Better performance than Tencent's reimplementation)
train dataset: VOC 2012 + VOC 2007
test dataset: VOC 2007
test size: 544
test code: Faster rcnn (not use 07 metric)
test score threshold: 0.01
model | mAP | delta | release |
baseline | 73.3 | 0.0 | yes |
data agumentation | 76.9 | +3.6 | yes |
multi scale train | 79.3 | +2.4 | yes |
focal loss | 80.6 | +1.3 | yes |
group normalization | xxx | -0.5 | yes |
soft nms | xxx | -0.6 | yes |
mix up | 81.7 | +1.1 | yes |
label smooth | 82.1 | +0.4 | yes |
cosine learning rate | 83.1 | +1.0 | yes |
GIOU | 83.3 | +0.2 | yes |
remove anchor | 83.3 | 0 | yes |
multi scale test | 85.8 | 2.5 | yes |
-
clone YOLO_v3 repository
git clone https://github.com/qq751220449/yolov3_tensorflow.git
-
prepare data
(1) create your datasets
Create a new folder nameddata
in the directory where theyolov3_tensorflow
folder is located, and then create a new folder namedVOC2007
in thedata/
.
Then put datasets intodata/VOC2007
.The file structure is as follows:
|--yolov3_tensorflow
|--|--v1
|--|--v2
|--|--v3
|--data
|--|--VOC2007
|--|--|--Annotations
|--|--|--ImageSets
|--|--|--|--Main
|--|--|--JPEGImages
(2) convert data format
You should alterDATASET_PATH
andPROJECT_PATH
inconfig.py
, for example:
DATASET_PATH = /home/ice2019/yolov3_temsorflow/data
PROJECT_PATH = /home/ice2019/yolov3_temsorflow
and thencd yolov3_tensorflow/utils python voc.py
-
prepare initial weights
Download darknet53_448.weights firstly, put the initial weights intodarknet2tf/
, and thencd darknet2tf python3 convert_weights.py --weights_file=darknet53_448.weights --data_format=NHWC
-
train
nohup python train.py &
-
test
If you want to get a higher mAP, you can set the score threshold to 0.01、use multi scale test、flip test.
If you want to use it in actual projects, or if you want speed, you can set the score threshold to 0.2.nohup python test.py --gpu=0 -t07 &
-
continue train
You should alterContinue_To_Train
andCHECKPOINT_FILE
inconfig.py
, for example:
Continue_To_Train = True
CHECKPOINT_FILE = 'checkpoint/yolo.ckpt-99-0.7929'
-
convert checkpoint to pb file
You should alterCKPT2PB_CKPT_FILE
andCKPT2PB_PB_NAME
inconfig.py
, for example:
CKPT2PB_CKPT_FILE = 'checkpoint/yolo.ckpt-99-0.7929'
CKPT2PB_PB_NAME = 'frozen_model_20200103_99_7929.pb'
paper:
- YOLOv3: An Incremental Improvement
- Foca Loss for Dense Object Detection
- Group Normalization
- An Analysis of Scale Invariance in Object Detection - SNIP
- Deformable convolutional networks
- Scale-Aware Trident Networks for Object Detection
- Understanding the Effective Receptive Field in Deep Convolutional Neural Networks
- Bag of Freebies for Training Object Detection Neural Networks
- Generalized Intersection over Union: A Metric and A Loss for Bounding Box Regression
- Stonger-yolo
software
- Python3.6.5
- Numpy1.14.5
- Tensorflow.1.10.0
- Opencv3.4.1
hardware
- 8G 1080