Skip to content

sweetdream779/FR-android-dlib-opencv

 
 

Repository files navigation

Build Status

Facial Recognition on Android using dlib and opencv

This app demonstrate semi realtime face detection, tracking and recognition based on predefined face vectors.

Notes:

  1. Set env variable OPENCV_ANDROID_SDK

export OPENCV_ANDROID_SDK=/Users/hoopoe/Tools/OpenCV-android-sdk

  1. From https://github.com/davisking/dlib-models

copy

  • shape_predictor_5_face_landmarks.dat
  • dlib_face_recognition_resnet_model_v1.dat

to /sdcard/Download

  1. dlib adapted to work with -DANDROID_STL=gnustl_shared

  2. To enable Mobilenet/TF activity. You need to:

Copy some model from https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet_v1.md

Change some values manually

private static final int MAX_RESULTS = 500;

private static final int TF_OD_API_INPUT_SIZE = 416;

private static final String TF_OD_API_MODEL_FILE ="file:///android_asset/spc_mobilenet_v3_1x_0.52_cleaned.pb"

  1. To run "OCV-FTD": a) download "OpenCV 3.4.0dev Android SDK with contrib modules" from the following link: https://github.com/chaoyangnz/opencv3-android-sdk-with-contrib b) create "jniLibs" folder into following path: "FaceTracker/app/src/main" c) copy the pre-compiled libraries from OpenCV-android-sdk/sdk/native/libs into the newly created jniLibs folder d) copy "haarcascade_frontalface_default.xml" into "sdcard/Download"

  2. To run openalpr activities :

  • download jniLibs from this link. The folder contains precompiled libs for ANDROID_PLATFORM="android-21" and ANDROID_ABI="armeabi-v7a", "arm64-v8a", "x86_64". For compling with another ANDROID_PLATFORM or ANDROID_ABI use this script.
  • set env variable OPENALPR_LIBS

About

Facial recognition for Android with dlib and opencv.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 85.3%
  • C++ 14.1%
  • Other 0.6%