Object Detection
Finally found Google's release on Object Detection
https://github.com/tensorflow/models/tree/master/object_detection
Pre-requisites: Make sure to do the following:
mkdir /tensorflow_models
cd /tensorflow_models
git clone https://github.com/tensorflow/models.git
Follow the installation instructions, but at least install protobuf-compiler and run protoc ON EVERY BASH SHELL
apt-get install protobuf-compiler
cd /tensorflow_models/models/research
protoc object_detection/protos/*.proto --python_out=.
export PYTHONPATH=$PYTHONPATH:`pwd`:`pwd`/slimTest installation using:
python object_detection/builders/model_builder_test.py
Download VOC2007 (smaller in size) and then run 'create_pascal_tf_record' to generate TFRecords
cd /tf_files/SSD-Tensorflow
wget http://host.robots.ox.ac.uk/pascal/VOC/voc2007/VOCtrainval_06-Nov-2007.tar
tar xvf VOCtrainval_06-Nov-2007.tar
cd /tensorflow_models/models/object_detection
python create_pascal_tf_record.py --data_dir=/tf_files/SSD-Tensorflow/VOCdevkit \
--year=VOC2007 --set=train --output_path=/tmp/pascal_voc2007_train.record
python create_pascal_tf_record.py --data_dir=/tf_files/SSD-Tensorflow/VOCdevkit \
--year=VOC2007 --set=val --output_path=/tmp/pascal_voc2007_val.record
# I customized create_tf_record.py and dataset_util.py to work on my custom dataset
# This is needed to cutomize any folder tag, ignore difficult tag, provide a new label_map_path etc..
# Manual process: Create a new label_map_path pertaining to the new classification labels
#
# cp /tf_files/SSD-Tensorflow/MYDEVKIT_2/VOC2007/mydevkit_label_map.pbtxt /tensorflow_models/models/research/object_detection/data/mydevkit_label_map.pbtxt
python create_pascal_tf_record.py \
--data_dir=/tf_files/SSD-Tensorflow/MYDEVKIT_2 \
--year=VOC2007 \
--set=train \
--output_path=/tmp/mydev_train.record \
--label_map_path=/tensorflow_models/models/research/object_detection/data/mydevkit_label_map.pbtxt \
--folder_tag=VOC2007 \
--ignore_difficult_tags=True
python create_pascal_tf_record.py \
--data_dir=/tf_files/SSD-Tensorflow/MYDEVKIT_2 \
--year=VOC2007 \
--set=val \
--output_path=/tmp/mydev_val.record \
--label_map_path=/tensorflow_models/models/research/object_detection/data/mydevkit_label_map.pbtxt \
--folder_tag=VOC2007 \
--ignore_difficult_tags=TrueArrange the directory structure, create EXPORT variables
Generate TF records
Run training
Run eval
Run tensorboard
Exporting a model for inference
Running inference on new files
Controlling GPU memory
Last updated
Was this helpful?