Giter Club home page Giter Club logo

dlib-android's Introduction

dlib-android

Build Status

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 OpenCV android sdk https://sourceforge.net/projects/opencvlibrary/files/latest/download. Put contents of sdk native folder to third_party/opencv

  • 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
  • Buy Me a Coffee at ko-fi.com

Future tasks

dlib-android's People

Contributors

tzutalin avatar crowbarkz avatar harshuljain13 avatar pitel avatar serrokitskiy avatar flyingzhao avatar jjjtui avatar

Watchers

Michał Kłujszo avatar Jakub Zalewski avatar Cezary Nowak avatar James Cloos avatar ci.10clouds.com avatar Piotr Jaworski avatar  avatar Jakub Jodelka avatar Hubert Siwkin avatar Hubert Stachurski avatar Ewelina Szmielew avatar Maciej Pęśko avatar Kamil 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.