Face Recognition Operations - Verify From Person Directory

Verify whether a face belongs to a person in Person Directory.

Note

    • 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 Verify operation can only match faces obtained with the same recognition model, that is associated with the query face.
POST {endpoint}/face/{apiVersion}/verify

URI Parameters

Name In Required Type Description
apiVersion
path True

string

API Version

endpoint
path True

string

uri

Supported Cognitive Services endpoints (protocol and hostname, for example: https://{resource-name}.cognitiveservices.azure.com).

Request Body

Name Required Type Description
faceId True

string

The faceId of the face, come from "Detect".

personId True

string

Specify a certain person in PersonDirectory Person.

Responses

Name Type Description
200 OK

VerificationResult

A successful call returns the verification result.

Other Status Codes

FaceErrorResponse

An unexpected error response.

Headers

x-ms-error-code: string

Security

Ocp-Apim-Subscription-Key

The secret key for your Azure AI Face subscription.

Type: apiKey
In: header

AADToken

The Azure Active Directory OAuth2 Flow

Type: oauth2
Flow: accessCode
Authorization URL: https://api.example.com/oauth2/authorize
Token URL: https://api.example.com/oauth2/token

Scopes

Name Description
https://cognitiveservices.azure.com/.default

Examples

Verify from PersonDirectory

Sample request

POST {endpoint}/face/v1.2-preview.1/verify

{
  "faceId": "c5c24a82-6845-4031-9d5d-978df9175426",
  "personId": "815df99c-598f-4926-930a-a734b3fd651c"
}

Sample response

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

Definitions

Name Description
FaceError

The error object. For comprehensive details on error codes and messages returned by the Face Service, please refer to the following link: https://aka.ms/face-error-codes-and-messages.

FaceErrorResponse

A response containing error details.

VerificationResult

Verify result.

FaceError

The error object. For comprehensive details on error codes and messages returned by the Face Service, please refer to the following link: https://aka.ms/face-error-codes-and-messages.

Name Type Description
code

string

One of a server-defined set of error codes.

message

string

A human-readable representation of the error.

FaceErrorResponse

A response containing error details.

Name Type Description
error

FaceError

The error object.

VerificationResult

Verify result.

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.