Liveness Session Operations - Get Liveness With Verify Session Result
Get session result of detectLivenessWithVerify/singleModal call.
GET {endpoint}/face/{apiVersion}/detectLivenessWithVerify-sessions/{sessionId}
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
api
|
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). |
session
|
path | True |
string |
The unique ID to reference this session. |
Responses
Name | Type | Description |
---|---|---|
200 OK |
The request has succeeded. |
|
Other Status Codes |
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
Get LivenessWithVerify Session Result
Sample request
GET {endpoint}/face/v1.2/detectLivenessWithVerify-sessions/b12e033e-bda7-4b83-a211-e721c661f30e
Sample response
{
"sessionId": "b12e033e-bda7-4b83-a211-e721c661f30e",
"authToken": "eyJhbGciOiJFUzI1NiIsIm",
"status": "NotStarted",
"modelVersion": "2024-11-15",
"results": {
"attempts": [
{
"attemptId": 2,
"attemptStatus": "Succeeded",
"result": {
"livenessDecision": "realface",
"targets": {
"color": {
"faceRectangle": {
"top": 669,
"left": 203,
"width": 646,
"height": 724
}
}
},
"verifyResult": {
"matchConfidence": 0.08871888,
"isIdentical": false
},
"digest": "B0A803BB7B26F3C8F29CD36030F8E63ED3FAF955FEEF8E01C88AB8FD89CCF761",
"sessionImageId": "Ae3PVWlXAmVAnXgkAFt1QSjGUWONKzWiSr2iPh9p9G4I",
"verifyImageHash": "43B7D8E8769533C3290DBD37A84D821B2C28CB4381DF9C6784DBC4AAF7E45018"
}
},
{
"attemptId": 1,
"attemptStatus": "Failed",
"error": {
"code": "FaceWithMaskDetected",
"message": "Mask detected on face image.",
"targets": {
"color": {
"faceRectangle": {
"top": 669,
"left": 203,
"width": 646,
"height": 724
}
}
}
}
}
],
"verifyReferences": [
{
"referenceType": "image",
"faceRectangle": {
"top": 316,
"left": 131,
"width": 498,
"height": 677
},
"qualityForRecognition": "high"
}
]
}
}
Definitions
Name | Description |
---|---|
Face |
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. |
Face |
A response containing error details. |
Face |
A rectangle within which a face can be found. |
Image |
The type of image. |
Liveness |
The target from color image used for liveness classification. |
Liveness |
The outcome of the liveness classification. |
Liveness |
The targets used for liveness classification. |
Liveness |
The error of the liveness classification. |
Liveness |
The model version used for liveness classification. |
Liveness |
The face verification output. |
Liveness |
The detail of face for verification. |
Liveness |
The results of the liveness with verify call. |
Liveness |
Session result of detect liveness with verify. |
Liveness |
The liveness with verify session attempt. |
Liveness |
The results of the liveness with verify session. |
Operation |
The current status of the session. |
Quality |
Indicates quality of image for recognition. |
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 |
The error object. |
FaceRectangle
A rectangle within which a face can be found.
Name | Type | Description |
---|---|---|
height |
integer |
The height of the rectangle, in pixels. |
left |
integer |
The distance from the left edge if the image to the left edge of the rectangle, in pixels. |
top |
integer |
The distance from the top edge if the image to the top edge of the rectangle, in pixels. |
width |
integer |
The width of the rectangle, in pixels. |
ImageType
The type of image.
Name | Type | Description |
---|---|---|
Color |
string |
Color image. |
Depth |
string |
Depth image. |
Infrared |
string |
Infrared image. |
LivenessColorDecisionTarget
The target from color image used for liveness classification.
Name | Type | Description |
---|---|---|
faceRectangle |
The face region where the liveness classification was made on. |
LivenessDecision
The outcome of the liveness classification.
Name | Type | Description |
---|---|---|
realface |
string |
The algorithm has classified the target face as real. |
spoofface |
string |
The algorithm has classified the target face as a spoof. |
uncertain |
string |
The algorithm could not classify the target face as either real or spoof. |
LivenessDecisionTargets
The targets used for liveness classification.
Name | Type | Description |
---|---|---|
color |
The target from color image used for liveness classification. |
LivenessError
The error of the liveness classification.
Name | Type | Description |
---|---|---|
code |
string |
The error code. |
message |
string |
The error message. |
targets |
Targets used for liveness classification. |
LivenessModel
The model version used for liveness classification.
Name | Type | Description |
---|---|---|
2024-11-15 |
string |
LivenessWithVerifyOutputs
The face verification output.
Name | Type | Description |
---|---|---|
isIdentical |
boolean |
Whether the target liveness face and comparison image face match. |
matchConfidence |
number |
The target face liveness face and comparison image face verification confidence. |
LivenessWithVerifyReference
The detail of face for verification.
Name | Type | Description |
---|---|---|
faceRectangle |
The face region where the comparison image's classification was made. |
|
qualityForRecognition |
Quality of face image for recognition. |
|
referenceType |
The image type which contains the face rectangle where the liveness classification was made on. |
LivenessWithVerifyResult
The results of the liveness with verify call.
Name | Type | Description |
---|---|---|
digest |
string |
The server calculated digest for this request. If the client reported digest differs from the server calculated digest, then the message integrity between the client and service has been compromised and the result should not be trusted. For more information, see how to guides on how to leverage this value to secure your end-to-end solution. |
livenessDecision |
The liveness classification for the target face. |
|
sessionImageId |
string |
The image ID of the session request. |
targets |
Targets used for liveness classification. |
|
verifyImageHash |
string |
The sha256 hash of the verify-image in the request. |
verifyResult |
The face verification output. Only available when the request is liveness with verify. |
LivenessWithVerifySession
Session result of detect liveness with verify.
Name | Type | Description |
---|---|---|
authToken |
string |
Bearer token to provide authentication for the Vision SDK running on a client application. This Bearer token has limited permissions to perform only the required action and expires after the TTL time. It is also auditable. |
modelVersion |
The model version used for liveness classification. This is an optional parameter, and if this is not specified, then the latest supported model version will be chosen |
|
results |
The results of the liveness with verify session. |
|
sessionId |
string |
The unique ID to reference this session. |
status |
The current status of the session. |
LivenessWithVerifySessionAttempt
The liveness with verify session attempt.
Name | Type | Description |
---|---|---|
attemptId |
integer |
The attempt ID, start from 1. |
attemptStatus |
The status of the attempt. |
|
error |
The error of the liveness with verify call, will be null if there is result. |
|
result |
The result of the liveness with verify call, will be null if there is error. |
LivenessWithVerifySessionResults
The results of the liveness with verify session.
Name | Type | Description |
---|---|---|
attempts |
The attempts data of underlying liveness with verify call with the session. |
|
verifyReferences |
The references used for face verification. |
OperationState
The current status of the session.
Name | Type | Description |
---|---|---|
Canceled |
string |
The operation has been canceled by the user. |
Failed |
string |
The operation has failed. |
NotStarted |
string |
The operation has not started. |
Running |
string |
The operation is in progress. |
Succeeded |
string |
The operation has completed successfully. |
QualityForRecognition
Indicates quality of image for recognition.
Name | Type | Description |
---|---|---|
high |
string |
High quality. |
low |
string |
Low quality. |
medium |
string |
Medium quality. |