Legs or Hot Dogs image classifier

Dan Jarvis
May 18, 2017 · 4 min read

How to

mkdir $HOME/tf_files
docker run -it -v $HOME/tf_files:/tf_files danjarvis/tensorflow-android:1.0.0
cd /tf_files
git clone --depth 1 --branch master https://github.com/daj/legs-or-hotdogs-images.git photos
rm -rf photos/.git
cd /photos
ls -1
cd /tensorflow
python tensorflow/examples/image_retraining/retrain.py \
--bottleneck_dir=/tf_files/bottlenecks \
--how_many_training_steps 500 \
--model_dir=/tf_files/inception \
--output_graph=/tf_files/retrained_graph.pb \
--output_labels=/tf_files/retrained_labels.txt \
--image_dir /tf_files/photos
cd /tf_files
curl -O https://raw.githubusercontent.com/tensorflow/tensorflow/master/tensorflow/examples/image_retraining/label_image.py
# python label_image.py test_01_hotdogs.jpg
hot dogs (score = 0.89646)
legs (score = 0.10354)

The results

Next steps

Dan Jarvis

Written by

Machine Learning & Android — https://stackoverflow.com/cv/dj

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade