This is the Android demo app of DaisyKit project. Visit DaisyKit SDK.
Dependencies: Android NDK 21.3, CMake 3.10.2.
git clone --recurse-submodules https://github.com/open-daisylab/daisykit-android.git
Or
git clone https://github.com/open-daisylab/daisykit-android.git
cd daisykit-android
git submodule update --init
https://github.com/Tencent/ncnn/releases
- Download ncnn-YYYYMMDD-android-vulkan.zip or build ncnn for android yourself
- Extract ncnn-YYYYMMDD-android-vulkan.zip into app/src/main/jni and change the ncnn_DIR path to yours in app/src/main/jni/CMakeLists.txt
https://github.com/nihui/opencv-mobile
- Download opencv-mobile-XYZ-android.zip
- Extract opencv-mobile-XYZ-android.zip into app/src/main/jni and change the OpenCV_DIR path to yours in app/src/main/jni/CMakeLists.txt
- Open this project with Android Studio, build it and enjoy!
- Android ndk camera is used for best efficiency.
- Crash may happen on very old devices for lacking HAL3 camera interface.
- All models are manually modified to accept dynamic input shape.
- Most small models run slower on GPU than on CPU, this is common.
- FPS may be lower in dark environment because of longer camera exposure time.
No toolchains found in the NDK toolchains folder for ABI with prefix: arm-linux-androideabi
clang ++: error: unknown argument: '-static-openmp'
How to fix? Install NDK 21.3, CMake 3.10.2.
See into assets folder at app/src/main/assets
. There should be 3 subfolders here: models
, configs
, and images
. Initialize all git submodules.
Use above snippet to print to logcat.
#include <android/log.h>
#define LOG_TAG "testjni"
#define ALOG(...) __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__)