你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Liveness Session Operations - Get Liveness Session Result

获取 detectLiveness/singleModal 调用的会话结果。

GET {endpoint}/face/{apiVersion}/detectLiveness-sessions/{sessionId}

URI 参数

名称 必需 类型 说明
apiVersion
path True

string

API 版本

endpoint
path True

string (uri)

支持的认知服务终结点(协议和主机名,例如:https://{resource-name}.cognitiveservices.azure.com)。

sessionId
path True

string

要引用此会话的唯一 ID。

响应

名称 类型 说明
200 OK

LivenessSession

请求已成功。

Other Status Codes

FaceErrorResponse

意外的错误响应。

标头

x-ms-error-code: string

安全性

Ocp-Apim-Subscription-Key

Azure AI 人脸订阅的密钥。

类型: apiKey
在: header

AADToken

Azure Active Directory OAuth2 流

类型: oauth2
流向: accessCode
授权 URL: https://api.example.com/oauth2/authorize
令牌 URL: https://api.example.com/oauth2/token

作用域

名称 说明
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
              }
            }
          }
        }
      }
    ]
  }
}

定义

名称 说明
FaceError

错误对象。 有关人脸服务返回的错误代码和消息的综合详细信息,请参阅以下链接:https://aka.ms/face-error-codes-and-messages

FaceErrorResponse

包含错误详细信息的响应。

FaceRectangle

在其中可以找到人脸的矩形。

LivenessColorDecisionTarget

用于实时分类的颜色图像中的目标。

LivenessDecision

生存度分类的结果。

LivenessDecisionTargets

用于生存度分类的目标。

LivenessError

生存度分类的错误。

LivenessModel

用于实时分类的模型版本。

LivenessResult

生存度分类的结果。

LivenessSession

检测生存期的会话结果。

LivenessSessionAttempt

实时会话尝试。

LivenessSessionResults

实时会话的结果。

OperationState

会话的当前状态。

FaceError

错误对象。 有关人脸服务返回的错误代码和消息的综合详细信息,请参阅以下链接:https://aka.ms/face-error-codes-and-messages

名称 类型 说明
code

string

服务器定义的错误代码集之一。

message

string

错误的人工可读表示形式。

FaceErrorResponse

包含错误详细信息的响应。

名称 类型 说明
error

FaceError

错误对象。

FaceRectangle

在其中可以找到人脸的矩形。

名称 类型 说明
height

integer (int32)

矩形的高度(以像素为单位)。

left

integer (int32)

如果图像到矩形左边缘(以像素为单位)的距离。

top

integer (int32)

图像到矩形上边缘(以像素为单位)的距离。

width

integer (int32)

矩形的宽度(以像素为单位)。

LivenessColorDecisionTarget

用于实时分类的颜色图像中的目标。

名称 类型 说明
faceRectangle

FaceRectangle

进行活泼分类的人脸区域。

LivenessDecision

生存度分类的结果。

说明
realface

该算法已将目标人脸分类为真实。

spoofface

该算法已将目标人脸分类为欺骗。

uncertain

该算法无法将目标人脸分类为真实或欺骗。

LivenessDecisionTargets

用于生存度分类的目标。

名称 类型 说明
color

LivenessColorDecisionTarget

用于实时分类的颜色图像中的目标。

LivenessError

生存度分类的错误。

名称 类型 说明
code

string

错误代码。

message

string

错误消息。

targets

LivenessDecisionTargets

用于生存度分类的目标。

LivenessModel

用于实时分类的模型版本。

说明
2024-11-15

LivenessResult

生存度分类的结果。

名称 类型 说明
digest

string

此请求的服务器计算摘要。 如果客户端报告的摘要与服务器计算摘要不同,则客户端和服务之间的消息完整性已泄露,因此不应信任结果。 有关详细信息,请参阅有关如何利用此值来保护端到端解决方案的指南。

livenessDecision

LivenessDecision

目标人脸的活度分类。

sessionImageId

string

会话请求的图像 ID。

targets

LivenessDecisionTargets

用于生存度分类的目标。

LivenessSession

检测生存期的会话结果。

名称 类型 说明
authToken

string

持有者令牌,用于为客户端应用程序上运行的视觉 SDK 提供身份验证。 此持有者令牌具有有限的权限,只能执行所需的操作,并在 TTL 时间后过期。 它也是可审核的。

modelVersion

LivenessModel

用于实时分类的模型版本。 这是一个可选参数,如果未指定此参数,则将选择最新的受支持的模型版本

results

LivenessSessionResults

实时会话的结果。

sessionId

string

要引用此会话的唯一 ID。

status

OperationState

会话的当前状态。

LivenessSessionAttempt

实时会话尝试。

名称 类型 说明
attemptId

integer (int32)

尝试 ID,从 1 开始。

attemptStatus

OperationState

尝试的状态。

error

LivenessError

如果存在结果,则实时调用的错误将为 null。

result

LivenessResult

如果出现错误,则实时调用的结果将为 null。

LivenessSessionResults

实时会话的结果。

名称 类型 说明
attempts

LivenessSessionAttempt[]

尝试使用会话调用基础实时性的数据。

OperationState

会话的当前状态。

说明
Canceled

该操作已被用户取消。

Failed

操作失败。

NotStarted

操作尚未启动。

Running

操作正在进行中。

Succeeded

操作已成功完成。