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

dlib-android-app

Build Status

See http://dlib.netfor the main project documentation.

See dlib-androidfor 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

Android dlib人脸识别 dlib-android-app: Android app to demo dlib-android(https://github.com/tzutalin/dlib-android). Use the prebuilt shared-lib built from dlib-android_第1张图片

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

FaceDetfaceDet=newFaceDet(Constants.getFaceShapeModelPath());Bitmapbitmap=BitmapFactory.decodeFile("Image Path");Listresults=faceDet.detect(bitmap);for(finalVisionDetRetret:results) {Stringlabel=ret.getLabel();intrectLeft=ret.getLeft();intrectTop=ret.getTop();intrectRight=ret.getRight();intrectBottom=ret.getBottom();//Get 68 landmark pointsArrayListlandmarks=ret.getFaceLandmarks();for(Pointpoint:landmarks) {intpointX=point.x;intpointY=point.y;
    }
}

Pedestrian detection

PedestrianpedestrianDet=newPedestrianDet();ListpersonList=pedestrianDet.detect(imgPath);

License

License

你可能感兴趣的:(Android dlib人脸识别 dlib-android-app: Android app to demo dlib-android(https://github.com/tzutalin/dlib-android). Use the prebuilt shared-lib built from dlib-android)