Coder Social home page Coder Social logo

ai-tfl-xvii's Introduction

TF Lite Android App

Building in Android Studio with TensorFlow Lite AAR from JCenter.

The build.gradle is configured to use TensorFlow Lite's nightly build.

If you see a build error related to compatibility with Tensorflow Lite's Java API (example: method X is undefined for type Interpreter), there has likely been a backwards compatible change to the API. You will need to pull new app code that's compatible with the nightly build and may need to first wait a few days for our external and internal code to merge.

Building from Source with Bazel

  1. Follow the Bazel steps for the TF Demo App:

  2. Install Bazel and Android Prerequisites. It's easiest with Android Studio.

    • You'll need at least SDK version 23.
    • Make sure to install the latest version of Bazel. Some distributions ship with Bazel 0.5.4, which is too old.
    • Bazel requires Android Build Tools 26.0.1 or higher.
    • Bazel is incompatible with NDK revisions 15 and above, with revision 16 being a compile-breaking change. Download an older version manually instead of using the SDK Manager.
    • You also need to install the Android Support Repository, available through Android Studio under Android SDK Manager -> SDK Tools -> Android Support Repository.
  3. Edit your WORKSPACE to add SDK and NDK targets.

    NOTE: As long as you have the SDK and NDK installed, the ./configure script will create these rules for you. Answer "Yes" when the script asks to automatically configure the ./WORKSPACE.

    • Make sure the api_level in WORKSPACE is set to an SDK version that you have installed.
    • By default, Android Studio will install the SDK to ~/Android/Sdk and the NDK to ~/Android/Sdk/ndk-bundle (but the NDK should be a manual download until Bazel supports NDK 16. See bullet points under (1)).
  4. Build the app with Bazel. The demo needs C++11:

bazel build -c opt --cxxopt='--std=c++11' \
  //tensorflow/contrib/lite/java/demo/app/src/main:TfLiteCameraDemo
  1. Install the demo on a debug-enabled device:
adb install bazel-bin/tensorflow/contrib/lite/java/demo/app/src/main/TfLiteCameraDemo.apk

ai-tfl-xvii's People

Contributors

xviib avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.