MCPcopy Index your code
hub / github.com/Faceplugin-ltd/FaceRecognition-Android

github.com/Faceplugin-ltd/FaceRecognition-Android @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
112 symbols 244 edges 20 files 2 documented · 2%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Hugging Face - Here

Documentation- Here

Face Recognition SDK Android with 3D Passive Liveness Detection - Fully On Premise

Overview

Explore face recognition SDK from Faceplugin Top-ranked on NIST FRVT , coupled with an advanced iBeta level 2 liveness detection engine that effectively safeguards against printed photos, video replay, 3D masks, and deepfake threats, ensuring top-tier security.

This is on-premise face recognition SDK which means everything is processed in your phone and NO data leaves the device.

Try this APP on Google Play

Awesome Badge Star Badge issue pr

Screenshots

On the Youtube

Watch the video

Install License

The code below shows how to use the license: https://github.com/Faceplugin-ltd/FaceRecognition-Android/blob/370ecadae564788eaa84f288e342da742fde0c1a/app/src/main/java/com/faceplugin/facerecognition/MainActivity.kt#L30-L45

Please contact us to get the license.

Documentation

Setup

Copy the SDK (libfacesdk folder) to the root folder in your project.

Add SDK to the project in settings.gradle

rootProject.name = "YourProjectName"
include ':app'
include ':libfacesdk'

Add dependency to your build.gradle

implementation project(path: ':libfacesdk')

APIs

Activate SDK using license

public static native int setActivation(java.lang.String s);

Init model for face recognition and liveness detection

public static native int init(AssetManager var0);

Convert camera frame in YUV to Bitmap

public static native Bitmap yuv2Bitmap(byte[] var0, int var1, int var2, int var3);

Run face recognition and liveness detection

public static native List<FaceBox> faceDetection(Bitmap var0, FaceDetectionParam var1);

Extract feature vector for the enrollment

public static native byte[] templateExtraction(Bitmap var0, FaceBox var1);

Calculate cosine similarity for the matching

public static native float similarityCalculation(byte[] var0, byte[] var1);

SDK Codes

Code Status
0 Activate SDK successfully
-1 Invalid License Key
-2 Invalid AppID
-3 Expired License Key
-4 Activation Failed
-5 SDK Failed

Classes

FaceResult

Type Name Description
Rect rect Bounding box for face
int liveness Liveness status: 0 for spoof, 1 for real, less than 0 for unknown
int gender Gender classification result
int mask Mask presence: 0 for no mask, 1 for mask
int age Age estimation result
float yaw Yaw angle: -45 to 45 degrees
float roll Roll angle: -45 to 45 degrees
float pitch Pitch angle: -45 to 45 degrees
byte[] feature 2056-byte facial feature data
byte[] faceData Encrypted facial data
int orient Face orientation: 1 for no rotation, 2 for 90° rotation, 3 for 270° rotation, 4 for 180° rotation
int faceId Face ID in the tracking face mode
public class FaceResult {
    public Rect rect;
    public int liveness;
    public int gender;
    public int mask;
    public int age;
    public float yaw;
    public float roll;
    public float pitch;
    public byte[] feature;
    public byte[] faceData;
    public int    orient;
    public int faceId;

    public FaceResult() {
    }
}

Here's our official document

List of our Products

Contact

faceplugin.comfaceplugin.comfaceplugin.com

Extension points exported contracts — how you extend this code

ViewModeChanged (Interface)
(no doc) [1 implementers]
app/src/main/java/com/faceplugin/facerecognition/CaptureView.java

Core symbols most depended-on inside this repo

setViewMode
called by 8
app/src/main/java/com/faceplugin/facerecognition/CaptureView.java
cropFace
called by 4
app/src/main/java/com/faceplugin/facerecognition/Utils.java
setFaceBoxes
called by 4
app/src/main/java/com/faceplugin/facerecognition/FaceView.java
scale
called by 4
app/src/main/java/com/faceplugin/facerecognition/CaptureView.java
getLivenessThreshold
called by 4
app/src/main/java/com/faceplugin/facerecognition/SettingsActivity.kt
getEyecloseThreshold
called by 4
app/src/main/java/com/faceplugin/facerecognition/SettingsActivity.kt
init
called by 3
app/src/main/java/com/faceplugin/facerecognition/FaceView.java
getCameraLens
called by 3
app/src/main/java/com/faceplugin/facerecognition/SettingsActivity.kt

Shape

Method 87
Class 22
Enum 2
Interface 1

Languages

Java71%
Kotlin29%

Modules by API surface

app/src/main/java/com/faceplugin/facerecognition/CaptureView.java20 symbols
app/src/main/java/com/faceplugin/facerecognition/SettingsActivity.kt14 symbols
app/src/main/java/com/faceplugin/facerecognition/CaptureActivity.java14 symbols
app/src/main/java/com/faceplugin/facerecognition/CameraActivity.java11 symbols
app/src/main/java/com/faceplugin/facerecognition/DBManager.java8 symbols
app/src/main/java/com/faceplugin/facerecognition/MyGlobal.java7 symbols
app/src/main/java/com/faceplugin/facerecognition/FaceView.java6 symbols
app/src/main/java/com/faceplugin/facerecognition/Utils.java4 symbols
app/src/main/java/com/faceplugin/facerecognition/PersonAdapter.java4 symbols
app/src/main/java/com/faceplugin/facerecognition/MainActivity.kt4 symbols
app/src/main/java/com/faceplugin/facerecognition/SplashActivity.java3 symbols
app/src/test/java/com/faceplugin/facerecognition/ExampleUnitTest.kt2 symbols

For agents

$ claude mcp add FaceRecognition-Android \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact