diff --git a/tensorflow/examples/label_image/BUILD b/tensorflow/examples/label_image/BUILD index 9207fc6332d..2abbe9dacca 100644 --- a/tensorflow/examples/label_image/BUILD +++ b/tensorflow/examples/label_image/BUILD @@ -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( diff --git a/tensorflow/examples/label_image/README.md b/tensorflow/examples/label_image/README.md index a9e44745e5c..cfd0132a7ae 100644 --- a/tensorflow/examples/label_image/README.md +++ b/tensorflow/examples/label_image/README.md @@ -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