Latest NIST FRVT evaluation report 2024-12-20
🆔 ID Document Liveness Detection - Linux - Here  
🤗 Hugging Face - Here
📚 Product & Resources - Here
🛟 Help Center - Here
💼 KYC Verification Demo - Here
🙋♀️ Docker Hub - Here
This repository demonstrates an advanced face recognition technology by implementing face comparison based on face feature extraction and face matching algorithm.
It includes capabilities for testing face recognition in 1:N matching scenarios.
In this repo, we integrated
KBY-AI's face recognition solution intoWindows 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(Face Matching or Face Comparison) | 
| 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 | 
| No. | Repository | SDK Details | 
|---|---|---|
| 1 | Face Liveness Detection - Linux | Face Livness Detection | 
| 2 | Face Liveness Detection - Windows | Face Livness Detection | 
| 3 | Face Liveness Detection - C# | Face Livness Detection | 
| 4 | Face Recognition - Linux | Face Recognition | 
| 5 | Face Recognition - Windows | Face Recognition | 
| ➡️ | Face Recognition - C# | Face Recognition | 
To get
Face SDK(mobile), please visit products here:
This project uses KBY-AI's Face Recognition Server SDK, which requires a license per machine.
- 
To use the latest update, plesae download the project here
 - 
To request the license, please provide us with the
machine codeobtained from thegetMachineCodefunction. - 
Ensure you copy the
license.txtfile to thebin/x64/Debugfolder, as shown in the image below:
 
🧙Email: [email protected]
🧙Telegram: @kbyaisupport
🧙WhatsApp: +19092802609
🧙Discord: KBY-AI
🧙Teams: KBY-AI
- 
Step One
First, obtain the
machine codefor activation and request a license based on themachine code.textBoxMachineCode.Text = FaceSDK.GetMachineCode();
 - 
Step Two
Next, activate the SDK using the received license.
int ret = FaceSDK.SetActivation(license);
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.
ret = FaceSDK.InitSDK("data");
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. 
- 
SDK_ERROR
This enumeration represents the return value of the
initSDKandsetActivationfunctions.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 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 [68 * 2] landmarks_68 Face templates unsigned char [2048] templates 68 points facial landmark
 
Please refer to FaceSDK.cs, where all APIs are implemented.
- 
Face Detection
The
Face SDKprovides a single API for detecting faces, determiningface orientation(yaw, roll, pitch), assessingface quality, detectingfacial occlusion,eye closure,mouth opening, and identifyingfacial landmarks.The function can be used as follows:
FaceBox[] faceBoxes = new FaceBox[10]; int faceCount = FaceSDK.FaceDetection(pixels, imgBmp.Width, imgBmp.Height, faceBoxes, 10);
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 
FaceBoxarray allocated withmaxFaceCountfor storing the detected faces. - The fifth parameter: the count allocated for the maximum 
FaceBoxobjects. 
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. Thesetemplates can be used for face verification between two faces.The function can be used as follows:
FaceSDK.TemplateExtraction(pixels, imgBmp.Width, imgBmp.Height, ref faceBoxes[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 
FaceBoxobject obtained from thefaceDetectionfunction. 
If the
templateextraction is successful, the function will return0. Otherwise, it will return-1. - 
Calculation similiarity
The
FaceSDK.SimilarityCalculationfunction takes a byte array of twotemplates as a parameter.float similarity = FaceSDK.SimilarityCalculation(faceBoxes[0].templates, personList[i].Templates);
It returns the similarity value between the two
templates, which can be used to determine the level of likeness between the two individuals. 
The default thresholds are as the following below:
FaceRecognition-CSharp-.NET/FaceRecognition/Form1.cs
Lines 25 to 26 in 0b55245
  

