diff options
Diffstat (limited to 'tensorflow/examples/android/README.md')
-rw-r--r-- | tensorflow/examples/android/README.md | 39 |
1 files changed, 27 insertions, 12 deletions
diff --git a/tensorflow/examples/android/README.md b/tensorflow/examples/android/README.md index b0465f7faa..b6556cdef4 100644 --- a/tensorflow/examples/android/README.md +++ b/tensorflow/examples/android/README.md @@ -1,11 +1,24 @@ # TensorFlow Android Camera Demo -This folder contains a simple camera-based demo application utilizing TensorFlow. +This folder contains an example application utilizing TensorFlow for Android +devices. ## Description -This demo uses a Google Inception model to classify camera frames in real-time, -displaying the top results in an overlay on the camera image. +The demos in this folder are designed to give straightforward samples of using +TensorFlow in mobile applications. Inference is done using the Java JNI API +exposed by `tensorflow/contrib/android`. + +Current samples: + +1. [TF Classify](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/examples/android/src/org/tensorflow/demo/ClassifierActivity.java): + Uses the [Google Inception](https://arxiv.org/abs/1409.4842) + model to classify camera frames in real-time, displaying the top results + in an overlay on the camera image. +2. [TF Detect](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/examples/android/src/org/tensorflow/demo/DetectorActivity.java): + Demonstrates a model based on [Scalable Object Detection + using Deep Neural Networks](https://arxiv.org/abs/1312.2249) to + localize and track people in the camera preview in real-time. ## To build/install/run @@ -19,9 +32,9 @@ installed on your system. 3. The Android SDK and build tools may be obtained from: https://developer.android.com/tools/revisions/build-tools.html -The Android entries in [`<workspace_root>/WORKSPACE`](../../../WORKSPACE#L2-L13) must be -uncommented with the paths filled in appropriately depending on where you -installed the NDK and SDK. Otherwise an error such as: +The Android entries in [`<workspace_root>/WORKSPACE`](../../../WORKSPACE#L2-L13) +must be uncommented with the paths filled in appropriately depending on where +you installed the NDK and SDK. Otherwise an error such as: "The external label '//external:android/sdk' is not bound to anything" will be reported. @@ -29,19 +42,21 @@ The TensorFlow `GraphDef` that contains the model definition and weights is not packaged in the repo because of its size. It will be downloaded automatically via a new_http_archive defined in WORKSPACE. -**Optional**: If you wish to place the model in your assets manually (E.g. for -non-Bazel builds), remove the -`inception_5` entry in `BUILD` and download the archive yourself to the -`assets` directory in the source tree: +**Optional**: If you wish to place the models in your assets manually (E.g. for +non-Bazel builds), remove the `inception_5` and `mobile_multibox` entries in +`BUILD` and download the archives yourself to the `assets` directory in the +source tree: ```bash $ curl -L https://storage.googleapis.com/download.tensorflow.org/models/inception5h.zip -o /tmp/inception5h.zip +$ curl -L https://storage.googleapis.com/download.tensorflow.org/models/mobile_multibox_v1.zip -o /tmp/mobile_multibox_v1.zip $ unzip /tmp/inception5h.zip -d tensorflow/examples/android/assets/ +$ unzip /tmp/mobile_multibox_v1.zip -d tensorflow/examples/android/assets/ ``` -The labels file describing the possible classification will also be in the -assets directory. +The associated label and box prior files for the models will also be extracted +into the assets directory. After editing your WORKSPACE file to update the SDK/NDK configuration, you may build the APK. Run this from your workspace root: |