1 # Android Benchmark App
3 An Android sample app that run `.tflite` and measure performance.
5 You can run with two engines.
7 - Tensorflow Lite Interpreter
8 - NN API Delegate (onert)
12 In addition to aarch64-Android build, you need to specify more parameters.
14 - `ANDROID_BUILD_TOOLS_DIR` : Android `build-tools` directory (You may find it in Android SDK directory)
15 - `ANDROID_SDK_DIR` : Android SDK directory
16 - `TFLITE_MODEL_PATH` : A model to run (Only one model can be packed)
17 - `ANDROID_BOOST_ROOT` : Boost library root path
18 - This repo should contain `lib` and `include` directory
19 - How to build Boost for Android - Build with [this repo](https://github.com/moritz-wundke/Boost-for-Android)
24 make TARGET_OS=android \
27 NDK_DIR=/home/hanjoung/ws/android-tools/r20/ndk \
28 EXT_ACL_FOLDER=/home/hanjoung/ws/temp/arm_compute-v19.05-bin-android/lib/android-arm64-v8a-neon-cl \
29 ANDROID_BUILD_TOOLS_DIR=/home/hanjoung/ws/android-tools/sdk/build-tools/27.0.3/ \
30 ANDROID_SDK_DIR=/home/hanjoung/ws/android-tools/sdk \
31 TFLITE_MODEL_PATH=/Users/hanjoung/ws/ghent/STAR/nnfw/tests/scripts/models/cache/MODELS/mobilenet/mobilenet_v1_0.25_128.tflite \
32 ANDROID_BOOST_ROOT=/home/hanjoung/ws/gh/moritz-wundke/Boost-for-Android/build/out/arm64-v8a
35 And you will get `obj/contrib/android_benchmark_app/android-benchmark.unsigned.pkg`. This is an unsigned Android app package.
39 Before installing the package you probably need to sign the package.
41 - `apksigner` : This is in `build-tools` directory
42 - Your keystore : How-to is TBD
46 --ks ~/.android/debug.keystore \
47 --in Product/aarch64-android.release/obj/contrib/android_benchmark_app/android-benchmark.unsigned.pkg \
51 You should enter the keystore password. Then you will get `tflbench.apk`.
56 adb install tflbench.apk
57 adb uninstall com.ndk.tflbench # To uninstall