Skip to content

Latest commit

 

History

16 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TorgTech Android TensorFlow Lite Apps

GPU-accelerated Android NDK examples for running TensorFlow Lite computer-vision models on-device. The repository is useful for Android developers evaluating native TFLite GPU Delegate builds for driver-monitoring and ADAS-style prototypes.

Repository Map

  • Mati_DSMS/: camera-based face detection and face/iris landmark experiments using bundled MediaPipe TensorFlow Lite models.
  • Tarzan_ADAS/: dense depth, segmentation, object detection, and face mesh examples packaged as an Android NDK app.
  • Sahay_ADAS/: additional ADAS app source and assets covering dense depth, detection, segmentation, and face mesh models.
  • third_party/: TensorFlow Lite build scripts and checked-in support code used by the Android app projects.

Quick Build Targets

Folder What it contains Open/build from
Mati_DSMS/ Android app com.example.tflite_blazeface with CMake native code and arm64-v8a TensorFlow Lite libraries. Open Mati_DSMS/ in Android Studio.
Tarzan_ADAS/ Android app com.example.tflite_iris_landmark with CMake native code and arm64-v8a TensorFlow Lite libraries. Open Tarzan_ADAS/ in Android Studio.
Sahay_ADAS/ Native source and assets for ADAS demos; no Gradle project file is checked in under this folder. Inspect or port Sahay_ADAS/app/src/main/ into an Android app project.

1. How to Build & Run

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

1.2 build TensorFlow Lite library and GPU Delegate library

  • run the build script to build TensorFlow Library
$ mkdir ~/work
$ git clone https://github.com/Akhilesh-Gogikar/TorgTech.git
$ cd TorgTech/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/

$ ls -l tensorflow/bazel-bin/tensorflow/lite/delegates/gpu/

1.3 Download the needed assets

Mati_DSMS includes its model assets in the repository. For the ADAS app assets, run the downloader that is checked into the target app:

$ cd ~/work/TorgTech/Tarzan_ADAS/app/src/main/assets/model
$ bash download.sh

Sahay_ADAS/app/src/main/assets/model/download.sh is the matching downloader for the Sahay asset folder when porting that source into an Android app.

1.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 one checked-in Android Studio project from the quick build targets table, such as ~/work/TorgTech/Mati_DSMS or ~/work/TorgTech/Tarzan_ADAS.
  • 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

About

Repository for the Tarzan ADAS and Mati DSMS source code

Topics

Resources

Stars

0 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages