API Reference
init_sdk
Name
init_sdk
Description
Initializes the SDK.
Input
None
Output
Status code indicating the result of the initialization.
0: Success
Non-zero: Initialization failed
get_attribute
Name
get_attribute
Description
Detects and analyzes face.
Input
image (numpy.ndarray): Input image matrix
width (int): Width of the input image
height (int): Height of the input image
face_results (ctypes.POINTER): Pointer to a structure containing face results
max_face_num (int): Maximum number of faces to detect
mode (int): 0-> Enroll mode, 1-> Identify mode
Output
Status code indicating the result of getting attribute.
>0: Number of detected faces
0: No Face
otherwise: Error
Here is FaceResult
Structure.
(x1, y1)
Coordinate of the top-left corner of the bounding box of the detected face.
(x2, y2)
Coordinate of the bottom-right corner of the bounding box of the detected face.
liveness
Liveness score of detected face
0 -> SPOOF
1 -> REAL
-3 -> TOO SMALL FACE
-4 -> TOO LARGE FACE
-102 -> NO FACE
-103 -> LIVENESS CHECK FAILED
mask
Mask detection of the detected face
0 -> No, 1 -> Yes
glass
Glass detection of the detected face
0 -> No, 1 -> Yes
age
Estimated age of the detected face
gender
Gender prediction of the detected face
0 -> Male, 1 -> Female
feature
Template buffer. Extracted template will be stored
calculate_similarity
Name
calculate_similarity
Description
Calculates the similarity between two features
Input
feature_1 (numpy.ndarray): 1st feature
feature_2 (numpy.ndarray): 2nd feature
Output
Similarity score between the two features
The score ranges from 0.0 to 1.0 Default Threshold is 0.82
Last updated