YOLOv3 implemented with distributed tensorflow including train and inference module.
put
VOC 2007/2012
orcustom files
withVOC Annotation Format
underdata/
and run:
./run_prepare.sh -a
data meta info and anchor output as below:
max_width = 500, max_height = 500, max_box_per_image = 39
iteration 1: dists = 256748.369356
iteration 2: dists = 10246.3258411
...
...
('\naverage IOU for', 9, 'anchors:', '0.68')
29,53, 61,94, 73,205, 134,119, 135,271, 218,329, 256,162, 342,247, 363,374
copy
max_box_per_image
andanchors
intoyolo_darknet53_voc.json
or yourself config json file.max_width
andmax_height
are used to be width and height when converting data to tfrecord.
convert
VOC Annotation Format
image and label into tfrecord underdata/tfrecord/
./run_prepare.sh -t
confirm all parameters in the config file before begining to train, refering to
yolo_darknet53_voc.json
download the darknet53.conv.74 or tiny.weights from yolo homepage and put them underconf/init/
.
of course you can train with random initialization, for my limited experience, it could get similar mAP if your problem is not very complex like coco. I got very similar mAP on my other tasks execpt for convergence speed.
./run_train.sh -l
you must change the data path and model storage directory parameters and rewrite
distributed_train()
inrun_train.sh
, then replace-l
with-r
convert checkpoint model to pb format for inference
./run_convert.sh -d
predict the
VOC2007 Test
and output a single result file for every class.
./run_evaluate.sh -p
./run_evaluate.sh -e
Train Data | Test Data | Input Size | Model | Initialize | mAP | FLOPS |
---|---|---|---|---|---|---|
VOC2007+2012 | VOC2007 Test | 416*416 | DarkNet53(YOLOv3) | darknet53.conv.74 | 0.782 | 65.86 |
VOC2007+2012 | VOC2007 Test | 416*416 | YOLOFLY | tiny.weights | 0.691 | 9.78 |
aeroplane AP = 0.869675
bicycle AP = 0.858369
bird AP = 0.745337
boat AP = 0.714346
bottle AP = 0.656200
bus AP = 0.852547
car AP = 0.877897
cat AP = 0.860574
chair AP = 0.652006
cow AP = 0.777205
diningtable AP = 0.750408
dog AP = 0.815225
horse AP = 0.868844
motorbike AP = 0.848694
person AP = 0.837868
pottedplant AP = 0.536273
sheep AP = 0.725731
sofa AP = 0.754855
train AP = 0.847557
tvmonitor AP = 0.782320
mAP = 0.781596517434
Thanks to experiencor for his great job of keras-yolo3