GithubHelp home page GithubHelp logo

jangocheng / dlib-android-app Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tzutalin/dlib-android-app

0.0 1.0 0.0 302.86 MB

:dragon: Android app to demo dlib-android(https://github.com/tzutalin/dlib-android). Use the prebuilt shared-lib built from dlib-android

License: Apache License 2.0

Makefile 0.12% Java 99.40% Shell 0.48%

dlib-android-app's Introduction

dlib-android-app

Build Status Download

See http://dlib.net for the main project documentation.

See dlib-android for JNI lib. Refer to dlib-android/jni/jnilib_ex

Grap the source

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

Features

  • Support HOG detector

  • HOG Face detection

  • Facial Landmark/Expression

Demo

Demo video

Build

Android app

  • Open Android studio to build

  • Use command line to build (Optional)

On Windows platforms, type this command:

$ gradlew.bat assembleDebug

On Mac OS and Linux platforms, type these commands:

$ ./gradlew assembleDebug

or

$ make ; make install

Update shared lib (Optional)

You can build shared library from dlib-android

Copy the shared library to ./dlib/src/main/jniLibs/

Try directly

Download and install the apk

$ adb install demo/app-debug.apk

Otherwise, import the library to your build.gradle

repositories {
    maven {
        url 'https://dl.bintray.com/tzutalin/maven'
    }
}

dependencies {
    implementation 'com.tzutalin.dlib-android-app:dlib:1.0.4'
}

Sample code

Facial landmark detection

FaceDet faceDet = new FaceDet(Constants.getFaceShapeModelPath());
Bitmap bitmap = BitmapFactory.decodeFile("Image Path");
List<VisionDetRet> results = faceDet.detect(bitmap);
for (final VisionDetRet ret : results) {
    String label = ret.getLabel();
    int rectLeft = ret.getLeft();
    int rectTop = ret.getTop();
    int rectRight = ret.getRight();
    int rectBottom = ret.getBottom();
    // Get 68 landmark points
    ArrayList<Point> landmarks = ret.getFaceLandmarks();
    for (Point point : landmarks) {
        int pointX = point.x;
        int pointY = point.y;
    }
}

Pedestrian detection

Pedestrian pedestrianDet = new PedestrianDet();
List<VisionDetRet> personList = pedestrianDet.detect(imgPath);

License

License

dlib-android-app's People

Contributors

flyingzhao avatar jjjtui avatar longyany avatar mpomeroy avatar tzutalin avatar

Watchers

 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.