/recognition/compare

Description

Compute two face's holistic similarity and different components' similarity.

Parameter

Name Description
Required api_key Your registered API Key
api_secret Your registered API Secret
face_id1 The id of the first face
face_id2 The id of the second face
Optional async If set to true, the API would be invoked asynchronously (i.e. a session id would be returned immediately, which could be later used to retrieve the result via /info/get_session). Defaults to false.

Return Values

Field Type Description
component_similarity object List of computed component similarities (currently eyebrow, eye, nose and mouth). Each contain a similarity value between 0 ~ 100.
similarity float A float between 0~100, indicating the similarity between two faces or persons.

Parameter

https://apius.faceplusplus.com/v2/recognition/compare?api_secret=YOUR_API_SECRET&api_key=YOUR_API_KEY&face_id2=b864da69abc1bcf50e5e1a0ea8228077&face_id1=f31f90f78c11d5ba26f67e1302a3014d

JSON Response

{
    "component_similarity": {
        "eye": 73.679835, 
        "mouth": 77.390801, 
        "nose": 80.22716, 
        "eyebrow": 74.043414
    }, 
    "session_id": "822e13ce5ae9896dbb18f0141d3fd254", 
    "similarity": 74.905818
}

Error Code List

Error Code HTTP Status Code Error Message
1001 500 INTERNAL_ERROR
1003 403 AUTHORIZATION_ERROR
1003 403 INSUFFICIENT_PRIVILEGE_OR_QUOTA_LIMIT_EXCEEDED
1004 400 MISSING_ARGUMENTS
1005 400 INVALID_ARGUMENTS
1006 403 ILLEGAL_USE_OF_DEMO_KEY
1202 502 SERVER_TOO_BUSY
Google+