Skip to content
Object detection neural network for detecting a MacBook Air
Branch: master
Clone or download
Pull request Compare This branch is 6 commits ahead, 11 commits behind floft:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
google-images-download @ 6a3dd67
models @ 4298c3a
.gitignore
.gitmodules
README.md
annotate.sh
config.sh
eval.sh
export.sh
export_nonlite.sh
gen_sloth.sh
sloth.json
sloth2tf.py
sloth_common.py
sloth_config.py
ssd_mobilenet_v1_0.75_depth_quantized_300x300_coco14_sync.config
ssd_mobilenet_v1_coco.config
ssd_mobilenet_v1_ppn_shared_box_predictor_300x300_coco14_sync.config
tf_label_map.pbtxt
train.sh

README.md

Detect MacBook Air

Use an object detection neural network to detect a Mac in images.

Instructions

Get this code:

git clone --recursive https://github.com/WSU-RAS/detect-laptop
cd detect-laptop

Labeling images

Then, to label them in Sloth (see my Arch PKGBUILD):

./gen_sloth.sh
./annotate.sh # 'f' to label as laptop, space for next, Ctrl+S to save

Convert TensorFlow {tftrain,tfvalid,tftest}.record files:

./sloth2tf.py

Get pre-trained TensorFlow networks

wget http://download.tensorflow.org/models/object_detection/ssd_mobilenet_v1_coco_2018_01_28.tar.gz
wget http://download.tensorflow.org/models/object_detection/ssd_mobilenet_v1_0.75_depth_quantized_300x300_coco14_sync_2018_07_18.tar.gz
wget http://download.tensorflow.org/models/object_detection/ssd_mobilenet_v1_ppn_shared_box_predictor_300x300_coco14_sync_2018_07_03.tar.gz
for i in *.tar.gz; do tar xaf $i; done

Fix bug

To fix a bug, in models/research/object_detection/metrics/coco_tools.py change

results.dataset['categories'] = copy.deepcopy(self.dataset['categories'])

to

results.dataset['categories'] = self.dataset['categories']

Training

Uncomment the model you wish to train in config.sh.

Install dependencies:

sudo pacman -S cython
pip install --user pycocotools

Then run training and monitor the results:

./train.sh
tensorboard --logdir float:object_detection_models.float,quantized:object_detection_models.quantized,ppn:object_detection_models.ppn

Export model

Export the model for TensorFlow Lite:

./export.sh
You can’t perform that action at this time.