Liveness Session Operations - Get Liveness Session Result
取得 detectLiveness/singleModal 呼叫的會話結果。
GET {endpoint}/face/{apiVersion}/detectLiveness-sessions/{sessionId}
URI 參數
| 名稱 | 位於 | 必要 | 類型 | Description |
|---|---|---|---|---|
|
api
|
path | True |
string |
API 版本 |
|
endpoint
|
path | True |
string (uri) |
支持的認知服務端點(通訊協定和主機名,例如:https://{resource-name}.cognitiveservices.azure.com)。 |
|
session
|
path | True |
string |
參考此工作階段的唯一標識碼。 |
回應
| 名稱 | 類型 | Description |
|---|---|---|
| 200 OK |
要求已成功。 |
|
| Other Status Codes |
未預期的錯誤回應。 標題 x-ms-error-code: string |
安全性
Ocp-Apim-Subscription-Key
Azure AI 臉部訂用帳戶的秘密密鑰。
類型:
apiKey
位於:
header
AADToken
Azure Active Directory OAuth2 流程
類型:
oauth2
Flow:
accessCode
授權 URL:
https://api.example.com/oauth2/authorize
權杖 URL:
https://api.example.com/oauth2/token
範圍
| 名稱 | Description |
|---|---|
| https://cognitiveservices.azure.com/.default |
範例
Get LivenessSession Result
範例要求
GET {endpoint}/face/v1.2/detectLiveness-sessions/b12e033e-bda7-4b83-a211-e721c661f30e
範例回覆
{
"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
}
}
},
"digest": "B0A803BB7B26F3C8F29CD36030F8E63ED3FAF955FEEF8E01C88AB8FD89CCF761",
"sessionImageId": "Ae3PVWlXAmVAnXgkAFt1QSjGUWONKzWiSr2iPh9p9G4I"
}
},
{
"attemptId": 1,
"attemptStatus": "Failed",
"error": {
"code": "FaceWithMaskDetected",
"message": "Mask detected on face image.",
"targets": {
"color": {
"faceRectangle": {
"top": 669,
"left": 203,
"width": 646,
"height": 724
}
}
}
}
}
]
}
}
定義
| 名稱 | Description |
|---|---|
|
Face |
error 物件。 如需臉部服務所傳回錯誤碼和訊息的完整詳細數據,請參閱下列連結:https://aka.ms/face-error-codes-and-messages。 |
|
Face |
包含錯誤詳細數據的回應。 |
|
Face |
可以在其中找到臉部的矩形。 |
|
Liveness |
用於活躍度分類之色彩影像的目標。 |
|
Liveness |
活躍度分類的結果。 |
|
Liveness |
用於活躍度分類的目標。 |
|
Liveness |
活躍度分類的錯誤。 |
|
Liveness |
用於活躍度分類的模型版本。 |
|
Liveness |
活躍度分類的結果。 |
|
Liveness |
偵測即時的會話結果。 |
|
Liveness |
即時會話嘗試。 |
|
Liveness |
即時會話的結果。 |
|
Operation |
會話的目前狀態。 |
FaceError
error 物件。 如需臉部服務所傳回錯誤碼和訊息的完整詳細數據,請參閱下列連結:https://aka.ms/face-error-codes-and-messages。
| 名稱 | 類型 | Description |
|---|---|---|
| code |
string |
其中一組伺服器定義的錯誤碼。 |
| message |
string |
錯誤的人類可讀取表示法。 |
FaceErrorResponse
包含錯誤詳細數據的回應。
| 名稱 | 類型 | Description |
|---|---|---|
| error |
error 物件。 |
FaceRectangle
可以在其中找到臉部的矩形。
| 名稱 | 類型 | Description |
|---|---|---|
| height |
integer (int32) |
矩形的高度,以像素為單位。 |
| left |
integer (int32) |
如果影像到矩形左邊緣的距離,以像素為單位。 |
| top |
integer (int32) |
影像到矩形上邊緣的距離,以像素為單位。 |
| width |
integer (int32) |
矩形的寬度,以像素為單位。 |
LivenessColorDecisionTarget
用於活躍度分類之色彩影像的目標。
| 名稱 | 類型 | Description |
|---|---|---|
| faceRectangle |
建立活躍度分類所在的臉部區域。 |
LivenessDecision
活躍度分類的結果。
| 值 | Description |
|---|---|
| uncertain |
演算法無法將目標臉部分類為真實或詐騙。 |
| realface |
演算法已將目標臉部分類為真實。 |
| spoofface |
演算法已將目標臉部分類為詐騙。 |
LivenessDecisionTargets
用於活躍度分類的目標。
| 名稱 | 類型 | Description |
|---|---|---|
| color |
用於活躍度分類之色彩影像的目標。 |
LivenessError
活躍度分類的錯誤。
| 名稱 | 類型 | Description |
|---|---|---|
| code |
string |
錯誤碼。 |
| message |
string |
錯誤訊息。 |
| targets |
用於活躍度分類的目標。 |
LivenessModel
用於活躍度分類的模型版本。
| 值 | Description |
|---|---|
| 2024-11-15 |
LivenessResult
活躍度分類的結果。
| 名稱 | 類型 | Description |
|---|---|---|
| digest |
string |
此要求的伺服器計算摘要。 如果客戶端報告摘要與伺服器計算摘要不同,則用戶端與服務之間的訊息完整性已遭入侵,因此不應該信任結果。 如需詳細資訊,請參閱如何利用此值來保護端對端解決方案的指南。 |
| livenessDecision |
目標臉部的活躍度分類。 |
|
| sessionImageId |
string |
會話要求的映像標識碼。 |
| targets |
用於活躍度分類的目標。 |
LivenessSession
偵測即時的會話結果。
| 名稱 | 類型 | Description |
|---|---|---|
| authToken |
string |
持有人令牌,可為在用戶端應用程式上執行的視覺 SDK 提供驗證。 此持有人令牌的許可權有限,只能執行必要的動作,並在TTL時間之後到期。 它也可稽核。 |
| modelVersion |
用於活躍度分類的模型版本。 這是選擇性參數,如果未指定,則會選擇最新的支援模型版本 |
|
| results |
即時會話的結果。 |
|
| sessionId |
string |
參考此工作階段的唯一標識碼。 |
| status |
會話的目前狀態。 |
LivenessSessionAttempt
即時會話嘗試。
| 名稱 | 類型 | Description |
|---|---|---|
| attemptId |
integer (int32) |
嘗試標識碼,從 1 開始。 |
| attemptStatus |
嘗試的狀態。 |
|
| error |
實況呼叫的錯誤,如果結果為 null。 |
|
| result |
實況呼叫的結果,如果發生錯誤,將會是 Null。 |
LivenessSessionResults
即時會話的結果。
| 名稱 | 類型 | Description |
|---|---|---|
| attempts |
嘗試使用會話呼叫基礎活躍度的數據。 |
OperationState
會話的目前狀態。
| 值 | Description |
|---|---|
| NotStarted |
作業尚未啟動。 |
| Running |
作業正在進行中。 |
| Succeeded |
作業已順利完成。 |
| Failed |
作業失敗。 |
| Canceled |
使用者已取消作業。 |