• Stars
    star
    867
  • Rank 52,618 (Top 2 %)
  • Language
    C++
  • License
    MIT License
  • Created over 9 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

🐉 Port dlib to Android

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

More Repositories

1

awesome-visual-slam

📚 The list of vision-based SLAM / Visual Odometry open source, blogs, and papers
2,249
star
2

dlib-android-app

🐉 Android app to demo dlib-android(https://github.com/tzutalin/dlib-android). Use the prebuilt shared-lib built from dlib-android
Java
680
star
3

ImageNet_Utils

⏬ Utils to help download images by id, crop bounding box, label images, etc.
Python
632
star
4

Android-Object-Detection

☕ Fast-RCNN and Scene Recognition using Caffe
Java
305
star
5

OpenCV-RgbdOdometry

⛄ OpenCV RGBD-Odometry (Visual Odometry based RGB-D images)
C++
117
star
6

adb-event-record

adb-event-record is a tool to record sensor's events like touch event and so on using the ADB (Android Debug Bridge).
Python
102
star
7

build-opencv-for-android

An interactive script to download and build OpenCV and OpenCV contrib for Android
Shell
74
star
8

ros_caffe

☕ Integrate Caffe model into ROS
C++
70
star
9

miniglog

Portable glog for cross-platforms: Windows, Linux, Android, and iOS
C++
43
star
10

Boost.Compute-Android

Boost.Compute library for Android. A C++ Computing Library for OpenCL https://github.com/boostorg/compute
C
23
star
11

caffe_test

☕ Include Caffe to predict in C++
C++
17
star
12

example-grpc

Demonstrate the some of features of gRPC
Java
14
star
13

DriveRecorder

It's an Android application which is able to record the video when driving.
12
star
14

ros_sample_image_transport

ROS Receive and publish different topics about image
C++
11
star
15

minizip

Minizip for Unix/Linux and mobile devices
C
10
star
16

ReadPCMData

Read auido raw data from android phone
7
star
17

docker

Dockerfile's for building
Shell
6
star
18

Android-ConfigIO

A small and encapsulation library for creating, accessing, and modifying Key-Value configuration file in XML / JSON format
Java
4
star
19

android-ndk-downloader

[Drepeciated]⏬ A script to download android NDK
Python
4
star
20

task-scheduler

task-scheduler is an in-process scheduler to arrange and run the task periodically according to YAML config file
Python
3
star
21

tzutalin

1
star