Git Product home page Git Product logo

facelivenessdetection-windows's Introduction

👏 Product List

https://github.com/kby-ai/Product

👏 We have published the Face Liveness Detection, Face Recognition SDK and ID Card Recognition SDK for the server.

FaceLivenessDetection-Windows

Overview

This is the Face Liveness Detection Python project for Windows.

The demo is integrated with KBY-AI's Face Liveness Detection Server SDK.

We can customize the SDK to align with your specific requirements.

Face Liveness Detection Face Recognition
Face Detection Face Detection
Face Liveness Detection Face Recognition
Pose Estimation Pose Estimation
68 points Face Landmark Detection 68 points Face Landmark Detection
Face Quality Calculation Face Occlusion Detection
Face Occlusion Detection Face Occlusion Detection
Eye Closure Detection Eye Closure Detection
Mouth Opening Check Mouth Opening Check

For other solutions, please explore the following:

Face Liveness Detection - Android(Basic SDK)

Face Liveness Detection - iOS(Basic SDK)

Face Recognition - Android(Standard SDK)

Face Recognition - iOS(Standard SDK)

Face Recognition - Flutter(Standard SDK)

Face Recognition - React-Native(Standard SDK)

Face Recognition - React-Native(Standard SDK)

Face Attribute - Android(Premium SDK)

Face Attribute - iOS(Premium SDK)

Try the API

Online Demo

You can test the SDK using images from the following URL: https://web.kby-ai.com

image

Postman

To test the API, you can use Postman. Here are the endpoints for testing:

SDK License

This project uses KBY-AI's Face Liveness Detection Server SDK, which requires a license per machine.

How to run

We have not published facesdk1.dll. If you need the SDK DLL, please get in touch with us.

1. System Requirements

  • CPU: 2 cores or more (Recommended: 8 cores)
  • RAM: 4 GB or more (Recommended: 8 GB)
  • HDD: 4 GB or more (Recommended: 8 GB)
  • OS: Windows 7 or later
  • Dependency: OpenVINO™ Runtime (Version: 2022.3), ncnn Runtime(20220721) or later, Vulkan SDK Runtime(1.3.250)

2. Setup and Test

  • Clone the project:

    git clone https://github.com/kby-ai/FaceLivenessDetection-Windows.git
    
  • Download the model from Google Drive and unzip: click here

  • Run the python code:

    python test.py
    
  • Send us the machine code and replace the license.txt file you received. Then, run python code again.

    image

    image

About SDK

1. Initializing the SDK

  • Step One

    First, obtain the machine code for activation and request a license based on the machine code.

    machineCode = getMachineCode()
    print("machineCode: ", machineCode.decode('utf-8'))
    
  • Step Two

    Next, activate the SDK using the received license.

    setActivation(license.encode('utf-8'))
    

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

  • Step Three

    After activation, call the initialization function of the SDK.

    initSDK("data".encode('utf-8'))
    

    The first parameter is the path to the model.

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

2. Enum and Structure

  • SDK_ERROR

    This enumeration represents the return value of the 'initSDK' and 'setActivation' functions.

    Feature Value Name
    Successful activation or initialization 0 SDK_SUCCESS
    License key error -1 SDK_LICENSE_KEY_ERROR
    AppID error (Not used in Server SDK) -2 SDK_LICENSE_APPID_ERROR
    License expiration -3 SDK_LICENSE_EXPIRED
    Not activated -4 SDK_NO_ACTIVATED
    Failed to initialize SDK -5 SDK_INIT_ERROR
  • FaceBox

    This structure represents the output of the face detection function.

    Feature Type Name
    Face rectangle int x1, y1, x2, y2
    Liveness score (0 ~ 1) float liveness
    Face angles (-45 ~ 45) float yaw, roll, pitch
    Face quality (0 ~ 1) float face_quality
    Face luminance (0 ~ 255) float face_luminance
    Eye distance (pixels) float eye_dist
    Eye closure (0 ~ 1) float left_eye_closed, right_eye_closed
    Face occlusion (0 ~ 1) float face_occlusion
    Mouth opening (0 ~ 1) float mouth_opened
    68 points facial landmark float[] landmarks_68

    68 points facial landmark

3. APIs

  • Face Detection

    The Face SDK provides a single API for detecting faces, performing liveness detection, determining face orientation (yaw, roll, pitch), assessing face quality, detecting facial occlusion, eye closure, mouth opening, and identifying facial landmarks.

    The function can be used as follows:

    faceBoxes = (FaceBox * maxFaceCount)()
    faceCount = faceDetection(image_np, image_np.shape[1], image_np.shape[0], faceBoxes, maxFaceCount)
    

    This function requires 5 parameters.

    • The first parameter: the byte array of the RGB image buffer.
    • The second parameter: the width of the image.
    • The third parameter: the height of the image.
    • The fourth parameter: the 'FaceBox' array allocated with 'maxFaceCount' for storing the detected faces.
    • The fifth parameter: the count allocated for the maximum 'FaceBox' objects.

    The function returns the count of the detected face.

4. Thresholds

The default thresholds are as the following below: https://github.com/kby-ai/FaceLivenessDetection-Windows/blob/e7ffeecc21f6053828a744e127ddef2e8a34c4a2/test.py#L13-L25

facelivenessdetection-windows's People

Contributors

justin200914 avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.