Giter Site home page Giter Site logo

tensorflow_custom_object_detection_training's Introduction

Tensorflow Custom Object Detection Training

Training Custom object (knife) detection in Tensorflow object Detection API

Installation and Setup:

  1. Download Tensorflow Repository models: https://github.com/tensorflow/models

  2. Download model: https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/detection_model_zoo.md

  3. Clone the following Repo: https://github.com/EdjeElectronics/TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10

# labelImg  (Python2)
sudo apt-get install pyqt4-dev-tools
sudo pip install lxml
make qt4py2
python labelImg.py

# Run the following in Paperspace VM
sudo pip2 install tensorflow==1.5.0
sudo apt-get install protobuf-compiler python-pil python-lxml python-tk

export PYTHONPATH=~/Desktop/tf_training/models:$PYTHONPATH
export PYTHONPATH=~/Desktop/tf_training/models/research:$PYTHONPATH
export PYTHONPATH=~/Desktop/tf_training/models/research/slim:$PYTHONPATH

# Run the following from models/research:
protoc object_detection/protos/*.proto --python_out=.
export PYTHONPATH=$PYTHONPATH:`pwd`:`pwd`/slim

Steps:

  1. Extract contents of models in ~Deskop/tf_training

  2. Extract "faster_rcnn_inception_v2_coco" in models/research/object_detection

  3. Extract the contents of "TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10" to object_detection

  4. Empty the following directories: a) training b) inference_graph c) images/test d) images/train

  5. Create xml annotations using label_image/program/labelImg.py

  6. Convert xml annotations to csv by running the following in reference_code:

    python xml_to_csv.py
  7. Generate tf.record files for both test and train labels by running the following in reference_code:

    python generate_tfrecord.py --csv_input=images/train_labels.csv --image_dir=images/train --output_path=train.record
    python generate_tfrecord.py --csv_input=images/test_labels.csv --image_dir=images/test --output_path=test.record
  8. Create labelmap-"labelmap.pbtxt" and training configuration file-"faster_rcnn_inception_v2_pets.config"

  9. Copy training_files contents to object_detection directory and start training by using following command:

    python train.py --logtostderr --train_dir=training/ --pipeline_config_path=training/faster_rcnn_inception_v2_pets.config
  10. Export the inference_graph (trained model):

python export_inference_graph.py --input_type image_tensor --pipeline_config_path training/faster_rcnn_inception_v2_pets.config --trained_checkpoint_prefix training/model.ckpt-XXXX --output_directory inference_graph

tensorflow_custom_object_detection_training's People

Contributors

prasad01dalavi avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.