YOLO v3 re-implementation, and our code is based stronger-yolo, a huge thank to him.
-
clone this repository
git clone https://github.com/fanbinqi/YOLO3-TF.git
-
prepare data
(1) download datasets
Create a new folder nameddata
and then create a new folder namedVOC
in thedata/
.
Download VOC 2012_trainval 、VOC 2007_trainval 、VOC 2007_test, and put datasets intodata/VOC
, name as2012_trainval
、2007_trainval
、2007_test
separately.
The file structure is as follows:
|--YOLOV3-TF
|--data
|--|--VOC
|--|--|--2012_trainval
|--|--|--2007_trainval
|--|--|--2007_test
(2) convert data format
You should setDATASET_PATH
inconfig.py
to the path of the VOC dataset and thenpython voc_annotation.py
-
prepare initial weights
(1) yolov3 Download YOLOv3-608.weights firstly, put the yolov3.weights intoyolov3_to_tf/
, and thencd yolov3_to_tf python3 convert_weights.py --weights_file=yolov3.weights --dara_format=NHWC -- ckpt_file=./saved_model/yolov3_608_coco_pretrained.ckpt cd .. python rename.py
(2) mobilenet v2 if want to train model with MoBileNet V2, the re-trained model is in our repo ./weights
put the initial weight into `weights/`.
-
Train
python train.py
-
Test
python test.py cd mAP python main.py