This repo contains code for the "TensorFlow for poets 2" series of codelabs.
There are multiple versions of this codelab depending on which version of the tensorflow libraries you plan on using:
- For TensorFlow Lite the new, ground up rewrite targeted at mobile devices use this version of the codelab
- For the more mature TensorFlow Mobile use this version of the codealab.
This repo contains simplified and trimmed down version of tensorflow's example image classification apps.
- The TensorFlow Lite version, in
android/tflite
, comes from tensorflow/contrib/lite/. - The Tensorflow Mobile version, in
android/tfmobile
, comes from tensorflow/examples/android/.
The scripts
directory contains helpers for the codelab. Some of these come from the main TensorFlow repository, and are included here so you can use them without also downloading the main TensorFlow repo (they are not part of the TensorFlow pip
installation).
wget "http://download.tensorflow.org/example_images/flower_photos.tgz"
tar xzvf flower_photos.tgz && mv flower_photos tf_files/
python3 scripts/retrain.py --output_graph=tf_files/retrained_graph.pb --output_labels=tf_files/retrained_labels.txt --image_dir=tf_files/flower_photos
python3 scripts/label_image.py --input_height=299 --input_width=299 --input_layer="Mul" --image "tf_files/flower_photos/daisy/3475870145_685a19116d.jpg"