dlib android教程,GitHub - tzutalin/dlib-android: Port dlib to Android

dlib-android

2a726cd991c88efd5fc6a3ce81708ed3.png

Purpose

Port dlib to Android platform

You can build it to dynamic or static library for Android. You can also build dlib's sample to Android executable file.

You can refer to dlib-android-app which demonstrates dlib-android features

Grab the source

$ git clone --recursive https://github.com/tzutalin/dlib-android.git

$ cd dlib-android

$ ./envsetup

Prerequisites

Download Android-NDK from Android website.

After downloading, go to the directory to which you downloaded the package to extract it

Export ANDROID_NDK_HOME in ~/.bashrc

$ vim ~/.bashrc

export ANDROID_NDK_HOME=[NDK_PATH]/android-ndk-[version]

export PATH=$PATH:$ANDROID_NDK_HOME

Install Android Debug Bride (ADB). You can download it via Android SDK Manager or $ sudo apt-get install android-tools-adb

Prepare an Android device for test

Build JNI code and shared library for Android application

You can change the compiler architecture in dlib-android/jni/Application.mk

The way to build the shared library for Android application

$ cd [dlib-android]

$ python build.py

Alternative way to build native code and copy to the Android Studio's project manually:

$ cd [dlib-android]

$ ndk-build -j 2

$ cp -r libs/* androidstudio-examples/dlib-android-app/dlib/src/main/jniLibs

Run Android application

Open Android Studio's projects in androidstudio-examples/dlib-android-app to run face detection, face landmark, and so on

Folder structure

├── data # Test data or the models for detection and landmarks

├── dlib # Source files of dlib. It is a submodule

├── jni # Source files of JNI codes and their make files

├── androidstudio-examples # Android Studio's projects use the shared library built by this repo

├── tools # Tools and utilities

├── third_party # Like OpenCV and [miniglog](https://github.com/tzutalin/miniglog)

├── CMakeLists.txt # Use CMake to build instead of using Android.mk

├── LICENSE

└── README.md

Do you want to contribute

If you have any improvement or you've found any bug, send a pull request with the code.

Give me a star on this repository

09bec42bb47b9c831503cc51ab076820.png

Future tasks

Add more examples to dlib-android-app

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值