Faceplugin Docs
  • Welcome to Faceplugin
  • Face Recognition SDK
    • Face Recognition Android SDK
    • Face Recognition iOS SDK
    • Face Recognition React Native SDK
    • Face Recognition Flutter SDK
    • Face Recognition Ionic-Cordova SDK
    • Face Recognition Dot Net SDK
    • Open Source Face Recognition Windows SDK
    • Open Source Face Recognition Linux SDK
    • Open Source Face Recognition Javascript SDK
    • Open Source Face Recognition React SDK
    • Open Source Face Recognition Vue SDK
  • Liveness Detection SDK
    • Liveness Detection Android SDK
    • Liveness Detection iOS SDK
    • Liveness Detection Linux SDK
  • Palm Recognition SDK
    • Palm Recognition SDK
  • Request a License & Support
  • Contact US
Powered by GitBook
On this page
  • Code
  • Setup
  • APIs
  1. Face Recognition SDK

Face Recognition Android SDK

Face recognition Android SDK with liveness detection

PreviousFace Recognition SDKNextFace Recognition iOS SDK

Last updated 2 months ago

Code

Setup

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

  2. Add SDK to the project in settings.gradle

rootProject.name = "YourProjectName"
include ':app'
include ':libfacesdk'
  1. Add dependency to your build.gradle

implementation project(path: ':libfacesdk')

APIs

setActivation: This API is used to activate the SDK

public static native int setActivation(String var0);

Input

  • var0 (String): The license string

Return value

The SDK activation status code.

  • 0: Success

  • Non-zero: Activation failed

init: This API is used to initialize the SDK

public static native int init(AssetManager var0);

Input

  • var0 (AssetManager): An instance of AssetManager used to access application assets

Return value

The SDK initialization status code.

  • 0: Success

  • -1: License Key Error

  • -2: License AppID Error

  • -3: License Expired

  • -4: Activate Error

  • -5: Initialize SDK Error

faceDetection: This API is used to detect faces

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

Input

  • var0 (Bitmap): The Bitmap image

  • var1 (FaceDetectionParam): Parameters for face detection

Return value

A list of FaceBox objects representing the detected faces.

templateExtraction: This API is used to extract face template

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

Input

  • var0 (Bitmap): The Bitmap image

  • var1 (FaceBox): The bounding box of the detected face

Return value

A byte array representing the extracted template from the face

similarityCalculation: This API is used to calculate the similarity between two face templates

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

Input

  • var0 (byte[]): The byte array representing the first face template

  • var1 (byte[]): The byte array representing the second face template

Return value

A float value representing the similarity score between the two face templates The score ranges from 0.0 to 1.0 Default Threshold is 0.8

LogoGitHub - Faceplugin-ltd/FaceRecognition-Android: Face recognition SDK Android with 3D passive liveness detection (Face Detection, Face Landmarks, Face Recognition, Face Liveness, Face Pose, Face Expression, Face attributes)GitHub