dlib php,dlib-android-app

dlib-android-app

c0240cfba0c8ad3cf1fc507fa25a761b.png

download.svg

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

a1d44ac9044c9bd478739ad05eeb8169.png

4e970500b705bc6f6e192014bea2ead1.png

b84280bf09c69a4e1d4be9155c10f784.png

c24f7d4accd5bf93fda4292dfcb92aa9.gif

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 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 landmarks = ret.getFaceLandmarks();

for (Point point : landmarks) {

int pointX = point.x;

int pointY = point.y;

}

}

Pedestrian detection

Pedestrian pedestrianDet = new PedestrianDet();

List personList = pedestrianDet.detect(imgPath);

License

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值