• Stars
    star
    862
  • Rank 52,495 (Top 2 %)
  • Language
    C++
  • License
    MIT License
  • Created about 9 years ago
  • Updated about 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,200
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
675
star
3

ImageNet_Utils

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

Android-Object-Detection

β˜• Fast-RCNN and Scene Recognition using Caffe
Java
304
star
5

OpenCV-RgbdOdometry

β›„ OpenCV RGBD-Odometry (Visual Odometry based RGB-D images)
C++
113
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
97
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++
71
star
9

miniglog

Portable glog for cross-platforms: Windows, Linux, Android, and iOS
C++
44
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
9
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