aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/examples/label_image
diff options
context:
space:
mode:
authorGravatar Asim Shankar <ashankar@google.com>2016-12-06 16:59:55 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2016-12-06 17:05:37 -0800
commitbd65cda4051a042003096096ab9b05c73a15e65c (patch)
tree20d5be971859994ad11d4860c658e6b24932a8be /tensorflow/examples/label_image
parentd95969fe12764a2a5993a8a4b9e76d72aa3be818 (diff)
Java: LabelImage using Inception example.
Command-line program to: - Construct an image normalization graph G1 - Execute G1 in a session to produce a tensor of a batch of images - Import a pre-trained inception model into a graph G2 - Execute G2 in a session to find the best matching label In other words, the Java equivalent of: - C++ example https://github.com/tensorflow/tensorflow/tree/abbb4c1/tensorflow/examples/label_image - Go example https://github.com/tensorflow/tensorflow/blob/c427b7e89d1498b78d361bfe7345b2636a438893/tensorflow/go/example_inception_inference_test.go Another step in the journey that is #5 Change: 141247499
Diffstat (limited to 'tensorflow/examples/label_image')
-rw-r--r--tensorflow/examples/label_image/README.md12
1 files changed, 8 insertions, 4 deletions
diff --git a/tensorflow/examples/label_image/README.md b/tensorflow/examples/label_image/README.md
index e427ff7845..62385312b6 100644
--- a/tensorflow/examples/label_image/README.md
+++ b/tensorflow/examples/label_image/README.md
@@ -1,7 +1,10 @@
# TensorFlow C++ Image Recognition Demo
This example shows how you can load a pre-trained TensorFlow network and use it
-to recognize objects in images.
+to recognize objects in images in C++. For Java see the [Java
+README](https://github.com/tensorflow/tensorflow/tree/master/tensorflow/java),
+and for Go see the [godoc
+example](https://godoc.org/github.com/tensorflow/tensorflow/tensorflow/go#ex-package).
## Description
@@ -10,9 +13,9 @@ in on the command line.
## To build/install/run
-The TensorFlow `GraphDef` that contains the model definition and weights
-is not packaged in the repo because of its size. Instead, you must
-first download the file to the `data` directory in the source tree:
+The TensorFlow `GraphDef` that contains the model definition and weights is not
+packaged in the repo because of its size. Instead, you must first download the
+file to the `data` directory in the source tree:
```bash
$ wget https://storage.googleapis.com/download.tensorflow.org/models/inception_dec_2015.zip -O tensorflow/examples/label_image/data/inception_dec_2015.zip
@@ -49,6 +52,7 @@ I tensorflow/examples/label_image/main.cc:207] academic gown (896): 0.0232407
I tensorflow/examples/label_image/main.cc:207] bow tie (817): 0.0157355
I tensorflow/examples/label_image/main.cc:207] bolo tie (940): 0.0145023
```
+
In this case, we're using the default image of Admiral Grace Hopper, and you can
see the network correctly spots she's wearing a military uniform, with a high
score of 0.6.