Face Compare
Face Compare API allows you to compare two face images to determine if they correspond to the same person. A score higher than 0.7 is a good indicator that the two images belong to the same person.
You can also use a score of 0.67 or higher if the images are of the same person but taken at different times (years apart). The score is a number between 0 and 1, where 1 is a perfect match and 0 is a perfect mismatch. The score is calculated using a deep learning model trained on millions of face images.
If the liveness check is enabled in the provided server, you can check the liveness with the face compare feature in a single API call.
1:1 Face Compare
POST /compare
This endpoint is for 1:1 face compare, no person enrollment needed
Headers
Content-Type
application/json
x-api-key
<your-api-key>
Body
check_liveness
Required: yes
Type: boolean Default value: false Accepted values: false, true
Example:
If set to true, the liveness check is performed during 1:N face search if the face is found. If no face is found, liveness is not checked. Check liveness image requirement here
face_base_64
Required: Yes
Type: string Example:
The image should contain a single face. Liveness will be checked on this face if enabled.
min_similarity_score
Required: Yes
Type: float Default value: 0.7 Example:
The default value is a good indicator to confirm the match. You can also use a score of 0.67 or higher if the images are of the same person but taken at different times (years apart).
ref_face_base_64
Required: Yes
Type: string Example:
Each reference image should contain a single face.
Response
{
"is_match": true
}A face could not be detected in the image(s)
{
"code": "ERR_FACE_NOT_DETECTED",
"message": "A face could not be detected in the image(s)."
}Please use an API Key to access this endpoint
{
"code": "ERR_API_KEY_NOT_PRESENT",
"message": "The API key is missing from the request."
}API Key is invalid. Please provide a valid API Key
{
"code": "ERR_API_KEY_NOT_VALID",
"message": "The API key is not valid."
}The collection with the specified name does not exist
{
"code": "ERR_NOT_FOUND",
"message": "The requested entity could not be found."
}Liveness error. The metadata contains the code that provides specifics about the error
Common codes are:
EYES_CLOSED || FACE_CLOSE_TO_BORDER || FACE_CROPPED || FACE_NOT_LIVE || FACE_TOO_CLOSE || FACE_ANGLE_TOO_LARGE || FACE_IS_OCCLUDED || FACE_NOT_FOUND || FACE_TOO_SMALL || LICENSE_ERROR || TOO_MANY_FACES || UNKNOWN_ERROR
The images could not be decoded from base64
Last updated

