Face Recognition SDK Android with 3D Passive Liveness Detection - Fully On Premise
Overview
Explore our face recognition SDK
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
Screenshots
On the Youtube
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
```java
public static native int setActivation(java.lang.String s);
```
Init model for face recognition and liveness detection
```java
public static native int init(AssetManager var0);
```
Convert camera frame in YUV to Bitmap
```java
public static native Bitmap yuv2Bitmap(byte[] var0, int var1, int var2, int var3);
```
Run face recognition and liveness detection
```java
public static native List faceDetection(Bitmap var0, FaceDetectionParam var1);
```
Extract feature vector for the enrollment
```java
public static native byte[] templateExtraction(Bitmap var0, FaceBox var1);
```
Calculate cosine similarity for the matching
```java
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 |
```java
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