API Reference
get_deviceid
def get_deviceid() -> str:
Name
get_device_id
Description
Retrieves the Hardware ID.
Input
None
Output
The Hardware ID is returned as a standard Python string.
set_activation
def set_activation(license_key: str) -> int:
Name
set_activation
Description
Activates the SDK using the provided license key.
Input
license_key (str): License key string, this should be encoded as UTF-8.
Output
Status code indicating the result of the activation.
0: Success
Non-zero: Initialization failed
init_sdk
def init_sdk(model_path: str) -> int:
Name
init_sdk
Description
Initializes the SDK with the required dictionary files.
Input
model_path (str): Path to the engine binary files directory, This path must be provided as a UTF-8 encoded string.
Output
Status code indicating the result of the initialization.
0: Success
Non-zero: Initialization failed
processImage
def processImage(image: ndarray, width: int, height: int) -> str
Name
processImage
Description
Processes the ID document liveness check
Input
image (ndarray): Numpy array for input image file.
width (int): Width of image.
height (int): Height of image.
Output
A JSON-formatted result string
Example of Liveness Check Results
{
"screenReply":0.000424702302553,
"printedCopy":0.000000003402590,
"portraitReplace":0.037854608148336,
"status":"Ok"
}
Liveness Score Values (Default Threshold is 0.5)
≥ 0.5: Genuine, < 0.5: Spoof
Last updated