This repository contains sources that helps to build your own object-detection model by using tensorflow. Following two posts help you to understand.
- Conceptual post:
How to train your own Object Detector with TensorFlow’s Object Detector API - Tutorial post:
TensorFlow Object Detection API Tutorial
-
Creating Dataset
A. Prepare image datasets - Using crawler - AutoCrawler
B. Label the images - Choose image annotation program which helps label the image manually - LabelImg, RectLabel
C. Convert xml to csv - xml_to_csv.py D. Create TFRecord file - generate_tfrecord.py -
Training the model
A. Select pretrained model
B. Create label-map .pbtxt file
C. Modify coresponding config file of pretrained model
D. Excute train -
Test the model
(Will be update) A. Test out with jupyter notebook which is given by tensorflow tutorial docs.
- Clone tensorflow/model directroy from github
- Installation and compilation
Click here to see instructions
A. Install dependencies - (tensorflow may not support cuda 10)
B. Configure protobuf compilation
C. Add Libraries to PYTHONPATH
- export PYTHONPATH=$PYTHONPATH:pwd
:pwd
/slim
- Create your own dataset
A. Get ready for dataset
- There are several methods to prepare your own dataset: download images manually, from others researched data or etc.
- Recommended: Use relevant web crawler: AutoCrawler
1. Download at least 200 images for each label.
2. Split into train/test folders portion of 150 / 50 images.
3. Use image annotation tool to create bounding boxes on downloaded images manually.
4. For each saved image, check out a pair of .xml file and your image file.
1. Open up object_detection_tutorial.ipynb with command jupyter notebook
2. Run the cell with run all command <br>
- In the ipynb file line 50, the test images is selected in range of 1 - 6 of jpg files.
- For more test out result, you can add more images or use images of 'png' files along with the jpg files.
- Along with this, you need to modify the file format or the range of images as well.