Face - Verify Face To Face

Verify whether two faces belong to a same person or whether one face belongs to a person.
Remarks:

  • Higher face image quality means better identification precision. Please consider high-quality faces: frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger.
  • For the scenarios that are sensitive to accuracy please make your own judgment.
  • The 'recognitionModel' associated with the query faces' faceIds should be the same as the 'recognitionModel' used by the target face, person group or large person group.
POST {Endpoint}/face/v1.0/verify

URI Parameters

Name In Required Type Description
Endpoint
path True
  • string

Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com).

Request Header

Name Required Type Description
Ocp-Apim-Subscription-Key True
  • string

Request Body

Name Required Type Description
faceId1 True
  • string

FaceId of the first face, comes from Face - Detect

faceId2 True
  • string

FaceId of the second face, comes from Face - Detect

Responses

Name Type Description
200 OK

A successful call returns the verification result.

Other Status Codes

Error response.

Security

Ocp-Apim-Subscription-Key

Type: apiKey
In: header

Examples

Verify faces example

Sample Request

POST {Endpoint}/face/v1.0/verify
Ocp-Apim-Subscription-Key: {API key}
{
  "faceId1": "c5c24a82-6845-4031-9d5d-978df9175426",
  "faceId2": "815df99c-598f-4926-930a-a734b3fd651c"
}

Sample Response

{
  "isIdentical": true,
  "confidence": 0.9
}

Definitions

APIError

Error information returned by the API

Error

Error body.

VerifyFaceToFaceRequest

Request body for face to face verification.

VerifyResult

Result of the verify operation.

APIError

Error information returned by the API

Name Type Description
error

Error body.

Error

Error body.

Name Type Description
code
  • string
message
  • string

VerifyFaceToFaceRequest

Request body for face to face verification.

Name Type Description
faceId1
  • string

FaceId of the first face, comes from Face - Detect

faceId2
  • string

FaceId of the second face, comes from Face - Detect

VerifyResult

Result of the verify operation.

Name Type Description
confidence
  • number

A number indicates the similarity confidence of whether two faces belong to the same person, or whether the face belongs to the person. By default, isIdentical is set to True if similarity confidence is greater than or equal to 0.5. This is useful for advanced users to override "isIdentical" and fine-tune the result on their own data.

isIdentical
  • boolean

True if the two faces belong to the same person or the face belongs to the person, otherwise false.