Face Match with Liveness

Face match with liveness is an analytics to compare a real-time self-portrait photo (selfie) with a reference photo. The output from this process is 2 output consist of the liveness check result and the percentages of similarity result.

post
Face Match Liveness

https://api.cloud.nodeflux.io/v1/analytics/face-match-liveness
Send a POST request to https://api.cloud.nodeflux.io/v1/analytics/face-match-liveness by providing these arguments as application/json. This endpoint allows you to run the liveness check and face matching process in one pipeline.
Request
Response
Request
Headers
Content-type
required
string
application/json
Authorization
required
string
"YOUR AUTHORIZATION KEY"
x-nodeflux-timestamp
required
string
"the x-nodeflux-timestamp from your authorization key"
Response
202: Accepted
HTTP Mapping
{
"job": {
"id": "a-very-long-job-id",
"result": {
"status": "success",
"analytic_type": "FACE_MATCH_LIVENESS",
"result": [
{
"face_liveness": {
"live": true,
"live_score": 0.845223
}
},
{
"face_match": {
"match": true,
"smimilarity": 0.94731
}
}
],
}
},
"message": "Job successfully submitted!",
"ok": true
}

Request Body

Note for image input:

  • Maximum allowed image file size is 2 MB per image

  • The image should be represented in base64 data based on a.JPG format. You can use any online jpg-to-base64 encoder to get the base64 data.

  • Please provide exactly 2 images and ensure arranged in the correct order as: Image of the Identity Card (IC) or known as well as KTP, and Self-portrait (Selfie) image of the KTP's owner and please ensure only a single face is presented on the frame.

For more detail about image configuration please check the page Image Configuration Guideline.

Your request body should follow this format:

{
"additional_params": {
"similarity_threshold": 0.85,
"liveness_threshold": 0.85,
"auto_orientation": false,
"get_main_face": true
},
"images": [
"{INSERT_JPEG_IMAGE_AS_BASE64_STRING_FOR_KTP}",
"{INSERT_JPEG_IMAGE_AS_BASE64_STRING_FOR_YOUR_SELFIE}"
]
}

Key

Type

Details

similarity_threshold

float

This value is to set the face matching threshold, to define the face whether match or not match. You can fill it with a float between 0 to 1. The default value is 0.7.

liveness_threshold

float

This value is to set the face liveness threshold to define the face is real or spoof. You can fill it with a float between 0 to 1. The default value is 0.6.

auto_orientation

boolean

This parameter helps you to adjust image orientation. The default is false, to activate please fill it with true

get_main_face

boolean

This parameter helps you to filter the main face, it will take the bigger face on the frame to prevent multiple face detection. To activate this feature please fill the parameter with true.

Follow the example here:

{
"images": [
"data:image/jpeg;base64,iVB\
ORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEU\
AAAD///+l2Z/dAAAAM0lEQVR4nGP4/5/h/1+G/58ZDrAz3D/McH8\
yw83NDDeNGe4Ug9C9zwz3gVLMDA/A6P9/AFGGFyjOXZtQAAAAAEl\
FTkSuQmCC",
"data:image/jpeg;base64,iVB\
isdjnjOOJNBVSUhEUgAOSKSIACOEAAAQAQMAAAAlPW0iAAAABlBMVEU\
AAAD///+l2Z/dAAAAM0lEQVR4nGP4/5/h/1+G/58ZDrAz3D/McH8\
yw83NDDeNGe4Ug9C9zwz3gVLMDA/A6P9/ASKOASKDOKASNASLNKL\
FTkSuQmCC"
]
}

The base64 encoded jpeg string should follow the data URI scheme format. See below:

data:[<media type>][;base64],<data>

Valid base64 encoded jpeg string example:

data:image/jpeg;base64,iVB ORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEU AAAD///+l2Z/dAAAAM0lEQVR4nGP4/5/h/1+G/58ZDrAz3D/McH8 yw83NDDeNGe4Ug9C9zwz3gVLMDA/A6P9/AFGGFyjOXZtQAAAAAEl FTkSuQmCC