update label_image.py (#15022)

* add build rule for label_image.py

add label_image_py to BUILD and update README.md accordingly
This commit is contained in:
freedom" Koan-Sin Tan 2018-01-10 12:10:02 +08:00 committed by Shanqing Cai
parent c457383a1b
commit 25d275280d
2 changed files with 24 additions and 1 deletions

View File

@ -51,6 +51,16 @@ tf_cc_binary(
}),
)
py_binary(
name = "label_image_py",
srcs = ["label_image.py"],
main = "label_image.py",
srcs_version = "PY2AND3",
deps = [
"//tensorflow:tensorflow_py",
],
)
filegroup(
name = "all_files",
srcs = glob(

View File

@ -73,10 +73,23 @@ Python than the Python code mentioned in the
[Inception tutorial](https://www.tensorflow.org/tutorials/image_recognition/).
and could be easier to add visualization or debug code.
With tensorflow python package installed, you can run it like:
`bazel-bin/tensorflow/examples/label_image/label_image_py` should be there after
```bash
$ bazel build tensorflow/examples/label_image/...
```
Run
```bash
$ bazel-bin/tensorflow/examples/label_image/label_image_py
```
Or, with tensorflow python package installed, you can run it like:
```bash
$ python3 tensorflow/examples/label_image/label_image.py
```
And get result similar to this:
```
military uniform 0.834305