- clone YOLO_v2 repository
git clone https://github.com/Stinky-Tofu/YOLO_v2.git
- Download dataset
Create a new folder nameddata
in the directory where theYOLO
folder is located, and then create a new folder namedPascal_voc
in thedata/
.
Download Pascal VOC2012 and Pascal VOC2007 dataset, then put the two datasets intodata/Pascal_voc/
, namedata/Pascal_voc/VOC2012
asdata/Pascal_voc/VOCdevkit
, and namedata/Pascal_voc/VOC2007
asdata/Pascal_voc/VOCdevkit-test
- Download pre-trained model
Download the model had trained on coco datasets yolo_coco_initial.ckpt(This model pre-trained on the coco dataset and then modified the last convolutional layer to apply to the Pascal_VOC dataset.), then put this model intoYOLO/model/
- Train
python train.py
--model_file(The name of the model under `YOLO/model/`, the default is `yolo_coco_initial.ckpt`)
--gpu(Gpu used during training, the default is `0,1`)
5. Test
Download the model had trained on Pascal_voc and coco datasets yolo.ckpt, then put this model into YOLO/model/
python test.py
--model_file(The name of the model under `YOLO/model/`, the default is `yolo.ckpt`)
--image_path(The path of the image used for testing, the default is `./data/image.jpg`)
--image_save_path(The path use for save image, the default is `./data/image_detected.jpg`)
--gpu(Gpu used during testing,the default is `0,1`)
. Tensorflow
. Opencv2