API
FPT.AI Reader - Facematch
Requirements
- The input image size does not exceed 5 MB and the minimum resolution is approximately 640x480 to ensure the confident rate.
- The ratio of face area must be at least ¼ of the total image area.
- Extension must be jpg/jpeg
Standard image
Bad image
- Image with low quality and lack of corner
- Image with low quality and lack of information
Request
Request Url
POST https://api.fpt.ai/dmp/checkface/v1/
Request Headers
Parameter | Required | Default | Description |
---|---|---|---|
api_key | Yes | Your api key ( get from console.fpt.ai ) |
Request Body
FormData contain 2 images that need to be checked
Parameter | Required | Description |
---|---|---|
file[] | Yes | |
file[] | Yes |
Note: append "file[]" 2 times in form data
Sample Request
curl --location --request POST 'https://api.fpt.ai/dmp/checkface/v1' \
--header 'api_key: xxxxxxxxxxxxxxxx' \
--form 'file[]=/path/to/file1' \
--form 'file[]=/path/to/file2'
Response
JSON
isMatch
: indicate 2 images are the same or not (base on a threshold of 80%)similarity
: how similar is one image to anotherisBothImgIDCard
: indicate 2 images are both image of ID card
{
"code" : "200",
"data" : {
"isMatch": false,
"similarity": 21.25160789489746,
"isBothImgIDCard": false
},
"message": "request successful."
}
Response Code
Code | Meaning |
---|---|
200 | Success |
407 | No faces detected |
408 | Allowed extensions are jpg, jpeg |
409 | More or less than 2 images for face check |
Sample Response: Success
{
"code" : "200",
"data" : {
"isMatch": false,
"similarity": 21.25160789489746,
"isBothImgIDCard": false
},
"message": "request successful."
}
Sample Response: Error
{
"code": "409",
"data": "Please upload only 2 images for face check",
"message": "request successful."
}