Take you quickly use YOLOv3, trained their goals detector

After the premise of this article is to use open source great God come to sum up, take you avoid pit road, take you quickly use on YOLOv3, can not understand how it works, and know that it is a target detector like to help you automatic detection of the position of the picture items.

First of all, the great God Kai Source: https://github.com/YunYang1994/tensorflow-yolov3 , the code is all about is the code used by the god when voc training data, so you train your data less than some of the code.

Here is the entire procedure is purely personal understanding, there are different opinions welcome.

A First Great God code clones down:

$ git clone https://github.com/YunYang1994/tensorflow-yolov3.git

If the routine is to identify the object, use the power of God part 2 of the quick start just fine, but if it is their own particular set of data items, see the following explanation:

1. Make your own training image data sets, tools labelimg, can be found online at the official installation and use tutorial, not elaborated here, python3 user recommended installation methods:

pip  install labelimg

Start the software in the terminal input labelimg

The image data after format flag xml, the xml data extraction data.txt, in the format:

Xxx/xxx.jpg 48,240,195,371,11 8,12,352,498,14   #注意逗号和空格的位置

#image path x_min,ymin,x_max,y_max,class_id x_min,y_min   

Image path recommended path relative to the train.py

Define your own class name of the file: Class.nams:

Person
car

Here the data has been extracted in the form of data.txt, God would not have the code voc_annotation.py large training VOC data

Data.txt by a certain percentage will be divided into trian.txt and test.txt, used to train the network and test results.

3. Edit ./core/config.py configuration items

_C.YOLO.CLASSES =”./data/classes/class.names”

_C.TRAIN.ANNOT_PATH=”./data/dataset/train.txt”

_C.TEST.ANNOT_PATH=”./data/dataset/test.txt”

Great God in two training methods of training methods are recommended to migrate learning training, 50 times last iteration end of the training, the right to retain the most errors under heavy file ckpt.

Here we are more confused convert_weight.py not take the code, this code is not in fact use. When we had just copy down the code should be noted .ckpt source code file does not exist, so the role of this code is to turn the model into a file yolov3.weight .ckpt file! !

So the following step should be directly in code freeze_graph.py will ckpt documents into pb file, the picture is called to identify the object.

Prior to conversion of the freeze_graph.py pb.file change model file name you want, ckpt_file instead of training you want to convert out of ckpt file.

Now you're done, happy object source code provided image_demo vedio_demo codes and the identification image and the video bar.

Published 12 original articles · won praise 0 · Views 432

Guess you like

Origin blog.csdn.net/qq_36523203/article/details/103575263