GithubHelp home page GithubHelp logo

shimingliangdm / android_tflite Goto Github PK

View Code? Open in Web Editor NEW

This project forked from terryky/android_tflite

0.0 0.0 0.0 232.13 MB

GPU Accelerated TensorFlow Lite applications on Android NDK. Higher accuracy face detection, Age and gender estimation, Human pose estimation, Artistic style transfer

License: MIT License

Shell 0.13% C++ 61.12% C 24.01% Java 7.34% CMake 7.39%

android_tflite's Introduction

GPU Accelerated TensorFlow Lite applications on Android NDK.

Run and measure the performance of TensorFlow Lite GPU Delegate on Android NDK.

1. Applications

  • Lightweight Face Detection.
  • Higher accurate Face Detection.
  • Image Classfication using Moilenet.
  • Object Detection using MobileNet SSD.
  • Hair segmentation and recoloring.
  • 3D Handpose Estimation from single RGB images.
  • Eye position estimation by detecting the iris.
  • Pose Estimation.
  • Assign semantic labels to every pixel in the input image.
  • Human portrait drawing by U^2-Net.
  • Create new artworks in artistic style.

2. How to Build & Run

2.1 setup environment

$ mkdir ~/Android/
$ mv ~/Download/android-ndk-r20b-linux-x86_64.zip ~/Android
$ cd ~/Android
$ unzip android-ndk-r20b-linux-x86_64.zip
  • Download and install bazel.
$ wget https://github.com/bazelbuild/bazel/releases/download/3.1.0/bazel-3.1.0-installer-linux-x86_64.sh
$ chmod 755 bazel-3.1.0-installer-linux-x86_64.sh
$ sudo ./bazel-3.1.0-installer-linux-x86_64.sh

2.2 build TensorFlow Lite library and GPU Delegate library

  • run the build script to build TensorFlow Library
$ mkdir ~/work
$ git clone https://github.com/terryky/android_tflite.git
$ cd android_tflite/third_party/
$ ./build_libtflite_r2.4_android.sh

(Tensorflow configure will start after a while. Please enter according to your environment)


$ ls -l tensorflow/bazel-bin/tensorflow/lite/
-r-xr-xr-x  1 terryky terryky 3118552 Dec 26 19:58 libtensorflowlite.so*

$ ls -l tensorflow/bazel-bin/tensorflow/lite/delegates/gpu/
-r-xr-xr-x 1 terryky terryky 80389344 Dec 26 19:59 libtensorflowlite_gpu_delegate.so*

2.3 Download the needed assets

$ cd ~/work/android_tflite
$ ./download_all_assets.sh

2.4 Build Android Applications

$ cd ${ANDROID_STUDIO_INSTALL_DIR}/android-studio/bin/
$ ./studio.sh
  • Install NDK 20.0 by SDK Manager of Android Studio.
  • Open application folder (eg. ~/work/android_tflite/tflite_posenet).
  • Build and Run.

3. Tested Environment

Host PC Target Device
x86_64 arm64-v8a
Ubuntu 18.04.4 LTS Android 9 (API Level 28)
Android NDK r20b

4. Related Articles

5. Acknowledgements

android_tflite's People

Contributors

terryky 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.