Face Liveness Detection

post
Face Liveness Detection

https://api.cloud.nodeflux.io/v1/analytics/face-liveness
Send a POST request to https://api.cloud.nodeflux.io/v1/analytics/face-liveness by providing these arguments as application/json. This endpoint allows you to verify the face liveness detction.
Request
Response
Request
Headers
content-type
required
string
application/json
Authorization
required
string
Your authorization key
x-nodeflux-timestamp
required
string
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_LIVENESS",
"result": [
{
"face_liveness": {
"live": true,
"liveness": 0.8966461420059204
}
}
]
}
},
"message": "Job successfully submitted!",
"ok": true
}

Request Body

Note for image input:

  • The maximum allowed image file size is 1 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 a self-portrait or selfie image and make sure 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": {
"liveness_threshold": 0.85,
"auto_orientation": false,
"get_main_face": true
},
"images": [
"{INSERT_JPEG_IMAGE_AS_BASE64_STRING_FOR_YOUR_SELFIE}"
]
}

Key

Type

Details

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.

Please follow this example:

{
"images": [
"data:image/jpeg;base64,iVB\
ORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEU\
AAAD///+l2Z/dAAAAM0lEQVR4nGP4/5/h/1+G/58ZDrAz3D/McH8\
yw83NDDeNGe4Ug9C9zwz3gVLMDA/A6P9/AFGGFyjOXZtQAAAAAEl\
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