Skip to main content

Liveness Check v2 (Deprecated)

Input image requirement​

For video​

  • The input video does not exceed 10MB and has the minimum resolution of 800x600 to ensure accuracy
  • The face area must take up at least 3/5 the total video frame
  • The video is 5-10 seconds long.

For attached image (to compare the face)​

  • The image to be compared with video does not exceed 5MB and has the minimum resolution of 800x600.

  • The face area must take up at least 3/5 the total image

API Information​

Request Url​

POST https://api.fpt.ai/dmp/checklive/v2

Request Headers​

ParameterRequiredDefaultDescription
api_keyYesyour api_key (from console.fpt.ai)

Request Body​

FormData containing the video and image to be checked

ParameterRequiredDescription
videoYesVideo of customer’s face naturally moving
cmndNoImage to be compared with the straightest face in video
detect_maskOptionalDetect face with mask in video

Sample Request​

curl --location --request POST 'https://api.fpt.ai/dmp/checklive/v2' \
--header 'api-key: xxxxxxxx' \
--form 'video=@"/video.mp4"' \
--form 'cmnd=@"/face.jpg"'

Response​

JSON​

{
"code": "200",
"message": "request successful.",
"is_live": true,
"prob": "0.006677149",
"need_to_review": false,
"is_deepfake": false,
"deepfake_prob": "0.0016087113",
"face_match": {
"isMatch": false,
"similarity": 1.8187788133647025
},
"face_match_error": {}
}

Returned Information​

FieldsDescription
codeCode/Error
is_liveVideo authentication result
is_deepfakeDeepfake detection result
face_matchFace matching result
face_match_errorFace matching error (if any)

Code​

CodeMeaning
200No error, see more results in the above fields
406Face in video is wearing mask (optional)
408More than 1 face in the video
409No video uploaded/Wrong extension
410No/Lost face in the video
411The face is too small
412The face is too blurry
413Video is still image
414Resolution of video is too low. Video is too short/long

Sample Response: Success​

{
"code": "200",
"message": "request successful.",
"is_live": true,
"prob": "0.006677149",
"need_to_review": false,
"is_deepfake": false,
"deepfake_prob": "0.0016087113",
"face_match": {
"isMatch": false,
"similarity": 81.81878813647025
}
}

Sample Response: Error​

{
"code": "200",
"message": "request successful.",
"is_live": true,
"prob": "0.006677149",
"need_to_review": false,
"is_deepfake": false,
"deepfake_prob": "0.0016087113",
"face_match_error": {
"code": "407",
"data": "No faces detected"
}
}

{
"code": "200",
"message": "request successful.",
"is_live": true,
"prob": "0.1212767",
"need_to_review": true,
"is_deepfake": true,
"deepfake_prob": "0.99999964",
"face_match": {
"isMatch": false,
"similarity": 8.060021979547948
}
}

{
"code": "200",
"message": "request successful.",
"is_live": false,
"prob": "0.9255054",
"need_to_review": false,
"face_match": {
"isMatch": false,
"similarity": 22.457926631125535
}
}

{
"code": "406",
"message": "request successful.",
"is_live": false,
"need_to_review": false,
"data": "Face in video is wearing mask"
}

{
"code": "408",
"message": "request successful.",
"data": "2 faces"
}

{
"code": "409",
"message": "request successful.",
"data": "Allowed extensions are mov, mp4, mkv, webm"
}

{
"code": "410",
"message": "request successful.",
"data": "No faces"
}

{
"code": "411",
"message": "request successful.",
"is_live": false,
"need_to_review": false
}

{
"code": "412",
"message": "request successful.",
"is_live": false,
"need_to_review": false
}

{
"code": "413",
"message": "request successful.",
"is_live": false,
"need_to_review": false
}

{
"code": "414",
"message": "request successful.",
"data": "Resolution of video is too low"
}