Face Comparison
Analyze the possibility of two faces belong to the same person. Using our face matching technology, you will get our judgment about whether it is the same person as well as a similarity score.
Code example:
curl --location --request POST 'https://api.ekycpro.com/v1/facecompare' \--header 'Content-Type: application/x-www-form-urlencoded' \--header 'X-API-Key: AbcdEfgh' \--data-urlencode 'img1=BASE64_ENCODE_VALUE' \--data-urlencode 'img2=BASE64_ENCODE_VALUE'
Response example for same person
{ "status": "OK", "message": { "similarity": 97.501, "result": "SAME PERSON" }}
Response example for not the same person
{ "status": "OK", "message": { "similarity": 27.501, "result": "NOT SAME PERSON" }}
Response example for not sure
{ "status": "OK", "message": { "similarity": 50.501, "result": "NOT SURE" }}
Response example for error request
{ "status": "INVALID_REQUEST", "message": "error message"}
Response example for uploaded image larger than 2M
{ "status": "IMAGE_INVALID_SIZE", "message": "image larger than 2M"}
Response example can not detect face
{ "status": "RETRY_LATER", "message": "image detect face fail"}
Response for server error
{ "status": "INNER_ERROR", "message": "Inner error, please retry later"}
HTTP request
POST https://api.ekycpro.com/v1/facecompare
Request parameters
parameter | description |
---|---|
img1 | string , first image in base64 encoded format |
img2 | string , second image in base64 encoded format |
Response format
fields | description |
---|---|
status | status code |
message | similarity : similarity score, 0~100 result : judgment |
Status code
status | description |
---|---|
OK | charge , success, message.similarity contains the similarity score |
RETRY_LATER | charge , image detect face failed |
INVALID_REQUEST | free , invalid request parameters |
IMAGE_INVALID_SIZE | free , image size larger than 2M |
INNER_ERROR | free , server error |
Judgment description
The scores below are reference values. To improve the acceptance rate of blurry images in actual use, it is recommended to adjust the scores appropriately.
Judgement Result | Description |
---|---|
SAME PERSON | Score >= 65 and <= 100, indicating that the two images belong to the same person. |
NOT SURE | Score >= 45 and < 65, indicating that the judgement cannot be made with certainty. |
NOT SAME PERSON | Score >= 0 and < 45, indicating that the two images belong to different people. |