Skip to content

Repository files navigation

🤗 Hugging Face - Here

📚 Product & Resources - Here

🛟 Help Center - Here

💼 KYC Verification Demo - Here

🙋‍♀️ Docker Hub - Here

FaceRecognition-Android

Overview

This repository demonstrates both face liveness detection and face recognition technology developed by KBY-AI.

In this repository, we integrated KBY-AI's both face liveness detection and face recognition technology into Android native platform.

◾FaceSDK(Mobile) Details

Basic🔽 StandardPremium
Face DetectionFace DetectionFace Detection
Face Liveness DetectionFace Liveness DetectionFace Liveness Detection
Pose EstimationPose EstimationPose Estimation
Face RecognitionFace Recognition
68 points Face Landmark Detection
Face Quality Calculation
Face Occlusion Detection
Eye Closure Detection
Age, Gender Estimation

◾FaceSDK(Mobile) Product List

No.RepositorySDK Details
1Face Liveness Detection - AndroidBasic SDK
2Face Liveness Detection - iOSBasic SDK
➡️Face Recognition - AndroidStandard SDK
4Face Recognition - iOSStandard SDK
5Face Recognition - FlutterStandard SDK
6Face Recognition - Ionic-CordovaStandard SDK
7Face Recognition - React-NativeStandard SDK
8Face Attribute - AndroidPremium SDK
9Face Attribute - iOSPremium SDK
10Face Attribute - FlutterPremium SDK

To get Face SDK(server), please visit products here.

Try the APK

Google Play

Performance Video

You can visit our YouTube video here to see how well our demo app works.

Face Recognition Android

Screenshots

SDK License

About SDK

1. Set up

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

  2. Add SDK to the project in settings.gradle.

include ':libfacesdk'
  1. Add dependency to your build.gradle.
implementation project(path: ':libfacesdk')

2. Initializing an SDK

  • Step One

To begin, you need to activate the SDK using the license that you have received.

FaceSDK.setActivation("...")

If activation is successful, the return value will be SDK_SUCCESS. Otherwise, an error value will be returned.

  • Step Two

After activation, call the SDK's initialization function.

FaceSDK.init(getAssets());

If initialization is successful, the return value will be SDK_SUCCESS. Otherwise, an error value will be returned.

3. SDK Classes

  • FaceDetectionParam

    This class serves as the input parameter for face detection, allowing the inclusion of face liveness detection and specifying the desired liveness detection level.

    FeatureTypeName
    Check livenessbooleancheck_liveness
    Check liveness levelintcheck_liveness_level

    When check_liveness_level is set to 0, the liveness detection achieves high accuracy. When check_liveness_level is set to 1, the liveness detection operates with light weight.

4. APIs

- Face Detection and Liveness Detection

The FaceSDK offers a single function for detecting faces, allowing the inclusion of face liveness detection and specifying the desired liveness detection level.

FaceSDK.faceDetection(bitmap, param)

This function requires two parameters: a Bitmap object and a FaceDetectionParam object that enables various processing functionalities.

The return value of the function is a list of FaceBox objects. Each FaceBox object contains the detected face rectangle, liveness score, and facial angles such as yaw, roll, and pitch.

- Create Templates

The FaceSDK provides a function that can generate a template from a Bitmap image. This template can then be used to verify the identity of the individual image captured.

byte[] templates =FaceSDK.templateExtraction(bitmap, faceBox);

The SDK's template extraction function takes two parameters: a Bitmap object and an object of FaceBox.

The function returns a byte array, which contains the template that can be used for person verification.

- Calculation similarity

The similarityCalculation function takes a byte array of two templates as a parameter.

float similarity =FaceSDK.similarityCalculation(templates1, templates1);

It returns the similarity value between the two templates, which can be used to determine the level of likeness between the two individuals.

- Yuv to Bitmap

The SDK provides a function called yuv2Bitmap, which converts a yuv frame to a Bitmap. Since camera frames are typically in yuv format, this function is necessary to convert them to Bitmap. The usage of this function is as follows:

Bitmap bitmap =FaceSDK.yuv2Bitmap(nv21, image.getWidth(), image.getHeight(), 7);

The first parameter is an nv21 byte array containing the yuv data.

The second parameter is the width of the yuv frame, and the third parameter is its height.

The fourth parameter is the conversion mode, which is determined by the camera orientation.

To determine the appropriate conversion mode, the following method can be used:

1234567888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888

About

Face recognition SDK Android with 3D passive face liveness detection(anti-spoofing). Standard Face Recognition SDK This repo supports the following functionality: face matching, face compare, face comparison, facial recognition, feature extraction, face identification, face anti-spoofing and face liveness detection for IDV

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages