GitPedia

FaceRecognition Docker

Face Recognition Docker, Face Liveness Detection, Face Search, Face Identification, Face Matching, Face Comparison, Facial Recognition

From kby-ai·Updated June 15, 2026·View on GitHub·

[Latest NIST FRVT evaluation report 2024-12-20](https://pages.nist.gov/frvt/html/frvt11.html) The project is written primarily in Python, distributed under the Other license, first published in 2023. Key topics include: docker, face-detection, face-recognition, face-recognition-python, face-recognition-sdk.

<p align="center"> <a href="https://play.google.com/store/apps/dev?id=7086930298279250852" target="_blank"> <img alt="" src="https://github-production-user-asset-6210df.s3.amazonaws.com/125717930/246971879-8ce757c3-90dc-438d-807f-3f3d29ddc064.png" width=500/> </a> </p>

Our facial recognition algorithm is globally top-ranked by NIST in the FRVT 1:1 leaderboards. <span><img src="https://github.com/kby-ai/.github/assets/125717930/bcf351c5-8b7a-496e-a8f9-c236eb8ad59e" alt="badge" width="36" height="20"></span>

Latest NIST FRVT evaluation report 2024-12-20

FRVT Sheet

🆔 ID Document Liveness Detection - Linux - Here <span><img src="https://github.com/kby-ai/.github/assets/125717930/bcf351c5-8b7a-496e-a8f9-c236eb8ad59e" alt="badge" width="36" height="20"></span>

🤗 Hugging Face - Here

📚 Product & Resources - Here

🛟 Help Center - Here

💼 KYC Verification Demo - Here

🙋‍♀️ Docker Hub - Here

bash
sudo docker pull kbyai/face-recognition:latest sudo docker run -e LICENSE="xxxxx" -p 8081:8080 -p 9001:9000 kbyai/face-recognition:latest

FaceRecognition-Docker

Overview

This repository demonstrates an advanced face recognition technology by implementing face comparison based on face feature extraction and face matching algorithm, which was implemented via a Dockerized Flask API.<br/>
It includes features that allow for testing face recognition between two images using both image files and base64-encoded images.

In this repo, we integrated KBY-AI's face recognition solution into Linux Server SDK by docker container.<br/>
We can customize the SDK to align with customer's specific requirements.

◾FaceSDK(Server) Details

Face Liveness Detection🔽 Face Recognition
Face Detection<b>Face Detection</b>
Face Liveness Detection<b>Face Recognition(Face Matching or Face Comparison)</b>
Pose Estimation<b>Pose Estimation
68 points Face Landmark Detection<b>68 points Face Landmark Detection</b>
Face Quality Calculation<b>Face Occlusion Detection</b>
Face Occlusion Detection<b>Face Occlusion Detection</b>
Eye Closure Detection<b>Eye Closure Detection</b>
Mouth Opening Check<b>Mouth Opening Check</b>

◾FaceSDK(Server) Product List

No.RepositorySDK Details
1Face Liveness Detection - LinuxFace Livness Detection
2Face Liveness Detection - WindowsFace Livness Detection
3Face Liveness Detection - C#<b>Face Livness Detection
➡️<b>Face Recognition - Linux</b><b>Face Recognition</b>
5Face Recognition - WindowsFace Recognition
6Face Recognition - C#Face Recognition

To get Face SDK(mobile), please visit products here:<br/>

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:

  • Test with an image file: Send a POST request to http://18.221.33.238:8081/compare_face.

  • Test with a base64-encoded image: Send a POST request to http://18.221.33.238:8081/compare_face_base64.

    You can download the Postman collection to easily access and use these endpoints. click here

    image

SDK License

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

Please contact us:</br>

🧙Email: contact@kby-ai.com</br>
🧙Telegram: @kbyaisupport</br>
🧙WhatsApp: +13348402323</br>
🧙Discord: KBY-AI</br>
🧙Teams: KBY-AI</br>

How to run

1. System Requirements

  • CPU: 2 cores or more (Recommended: 2 cores)
  • RAM: 4 GB or more (Recommended: 8 GB)
  • HDD: 4 GB or more (Recommended: 8 GB)
  • OS: Ubuntu 20.04 or later
  • Dependency: OpenVINO™ Runtime (Version: 2022.3)

2. Setup and Test

  • Clone the project:

    bash
    git clone https://github.com/kby-ai/FaceRecognition-Docker.git
  • Download the model from Google Drive: click here

    bash
    cd FaceRecognition-Docker wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=19vA7ZOlo19BcW8v4iCoCGahUEbgKCo48' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=19vA7ZOlo19BcW8v4iCoCGahUEbgKCo48" -O data.zip && rm -rf /tmp/cookies.txt unzip data.zip
  • Build the Docker image:

    bash
    sudo docker build --pull --rm -f Dockerfile -t kby-ai-face:latest .
  • Run the Docker container:

    bash
    sudo docker run -v ./license.txt:/home/openvino/kby-ai-face/license.txt -p 8081:8080 kby-ai-face
  • Send us the machine code and then we will give you a license key.

    After that, update the license.txt file by overwriting the license key that you received. Then, run the Docker container again.

    image

    image

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

    Test with an image file: Send a POST request to http://{xx.xx.xx.xx}:8081/compare_face.

    Test with a base64-encoded image: Send a POST request to http://{xx.xx.xx.xx}:8081/compare_face_base64.

    You can download the Postman collection to easily access and use these endpoints. click here

3. Execute the Gradio demo

  • Setup Gradio
    Ensure that you have the necessary dependencies installed.

    Gradio requires Python 3.6 or above.

    You can install Gradio using pip by running the following command:

    bash
    pip install gradio
  • Run the demo
    Run it using the following command:

    bash
    cd gradio python demo.py
  • You can test within the following URL:
    http://127.0.0.1:9000

About SDK

1. Initializing the SDK

  • Step One

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

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

    Next, activate the SDK using the received license.

    python
    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.

    python
    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.

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

    This structure represents the output of the face detection function.

    FeatureTypeName
    Face rectangleintx1, y1, x2, y2
    Face angles (-45 ~ 45)floatyaw, roll, pitch
    Face quality (0 ~ 1)floatface_quality
    Face luminance (0 ~ 255)floatface_luminance
    Eye distance (pixels)floateye_dist
    Eye closure (0 ~ 1)floatleft_eye_closed, right_eye_closed
    Face occlusion (0 ~ 1)floatface_occlusion
    Mouth opening (0 ~ 1)floatmouth_opened
    68 points facial landmarkfloat [68 * 2]landmarks_68
    Face templatesunsigned char [2048]templates

    68 points facial landmark

    <img src="https://user-images.githubusercontent.com/125717930/235560305-ee1b6a39-5dab-4832-a214-732c379cabfd.png" width=500/>

3. APIs

  • Face Detection

    The Face SDK provides a single API for detecting faces, 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:

    python
    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.

  • Create Template

    The SDK provides a function that enables the generation of templates from RGB data. These templates can be used for face verification between two faces.

    The function can be used as follows:

    python
    templateExtraction(image_np1, image_np1.shape[1], image_np1.shape[0], faceBoxes1[0])

    This function requires 4 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 object obtained from the faceDetection function.

    If the template extraction is successful, the function will return 0. Otherwise, it will return -1.

  • Calculation similiarity

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

    python
    similarity = similarityCalculation(faceBoxes1[0].templates, faceBoxes2[0].templates)

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

4. Thresholds

The default thresholds are as the following below:
https://github.com/kby-ai/FaceRecognition-Docker/blob/75800590cd9f2a3b778ec176bf465d1a731278fa/app.py#L18-L20

Contributors

Showing top 2 contributors by commit count.

View all contributors on GitHub →

This article is auto-generated from kby-ai/FaceRecognition-Docker via the GitHub API.Last fetched: 6/28/2026