This is implementation of YOLO v2 with TensorFlow.
-
Clone YOLO_tiny repository
$ git clone https://github.com/leeyoshinari/YOLO_v2.git $ cd YOLO_v2
-
Download Pascal VOC2007 dataset, and put the dataset into
data/Pascal_voc
.if you download other dataset, you also need to modify file paths.
-
Download weights file yolo_weights for COCO, and put weight file into
data/output
.Or you can also download my training weights file YOLO_v2 for VOC.
-
Modify configuration into
yolo/config.py
. -
Training
$ python train_val.py
-
Test
$ python test_val.py
Darknet-19 has 19 convolutional layers, it's faster than yolo_v2. If you use darknet-19, you need some modifications. It's easy to modify.
Please download Darknet-19 weights file for VOC from darknet-19.
To train the model on your own dataset, you should need to modify:
-
Put all the images into the
Images
folder, put all the labels into theLabels
folder. Select a part of the image for training, write this part of the image filename intotrain.txt
, the remaining part of the image filename written intest.txt
. Then put theImages
,Labels
,train.txt
andtest.txt
intodata/dataset
. Put weight file indata/output
. -
config.py
modify the CLASSES. -
train.py
replacefrom pascal_voc import Pascal_voc
withfrom preprocess import Data_preprocess
, and replacepre_data = Pascal_voc()
withpre_data = Data_preprocess()
.
- Tensorflow
- OpenCV