接口请求域名: faceid.intl.tencentcloudapi.com 。
使用活体比对(光线)SDK生成的数据包检测活体,并和传入的图片进行比对。
图片和SDK生成的数据内容必须存储在腾讯云COS,COS Bucket所在的Region需要和本接口请求的Region保持一致,推荐使用生成上传链接接口来完成资源传递。
默认接口请求频率限制:5次/秒。
以下请求参数列表仅列出了接口请求参数和部分公共参数,完整公共参数列表见 公共请求参数。
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| Action | 是 | String | 公共参数,本接口取值:DetectReflectLivenessAndCompare。 |
| Version | 是 | String | 公共参数,本接口取值:2018-03-01。 |
| Region | 是 | String | 公共参数,详见产品支持的 地域列表,本接口仅支持其中的: ap-bangkok, ap-hongkong, ap-singapore 。 |
| LiveDataUrl | 是 | String | SDK生成的活体检测数据包的资源地址。 |
| LiveDataMd5 | 是 | String | SDK生成的活体检测数据包的资源内容MD5(32位,用于校验LiveData的一致性)。 |
| ImageUrl | 是 | String | 用于比对的目标图片的资源地址。 |
| ImageMd5 | 是 | String | 用于比对的目标图片的资源MD5(32位,用于校验Image的一致性)。 |
| 参数名称 | 类型 | 描述 |
|---|---|---|
| BestFrameUrl | String | 验证通过后的视频最佳截图资源临时地址,jpg格式,资源和链接有效期2小时,务必在有效期内下载。 |
| BestFrameMd5 | String | 验证通过后的视频最佳截图资源MD5(32位,用于校验BestFrame的一致性)。 |
| Result | String | 业务错误码,成功情况返回Success,错误情况请参考下方错误码 列表中FailedOperation部分。 |
| Description | String | 业务结果描述。 |
| Sim | Float | 相似度,取值范围 [0.00, 100.00]。推荐相似度大于等于70时可判断为同一人,可根据具体场景自行调整阈值(阈值70的误通过率为千分之一,阈值80的误通过率是万分之一)。 |
| RequestId | String | 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 |
POST / HTTP/1.1
Host: faceid.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DetectReflectLivenessAndCompare
<公共请求参数>
{
"ImageMd5": "d41d8cd98f00b204e9800998ecf8427e",
"LiveDataUrl": "https://faceid-resource-sg-1254418846.cos.ap-singapore.myqcloud.com/faceid%2FApplyWebVerificationToken%2F1300268875%2F20b11b59-572d-406d-8d94-e6e05782134c",
"ImageUrl": "https://faceid-resource-sg-1254418846.cos.ap-singapore.myqcloud.com/faceid%2FApplyWebVerificationToken%2F1300268875%2F20b11b59-572d-406d-8d94-e6e05782134c",
"LiveDataMd5": "d41d8cd98f00b204e9800998ecf8427e"
}
{
"Response": {
"BestFrameUrl": "https://faceid-resource-sg-1254418846.cos.ap-singapore.myqcloud.com/faceid%2FApplyWebVerificationToken%2F1300268875%2F20b11b59-572d-406d-8d94-e6e05782134c",
"Description": "Success",
"BestFrameMd5": "d41d8cd98f00b204e9800998ecf8427e",
"RequestId": "00577fa0-9d11-459e-a455-fc202ecd65bc",
"Sim": 96.3,
"Result": "Success"
}
}
云 API 3.0 提供了配套的开发工具集(SDK),支持多种编程语言,能更方便的调用 API。
以下仅列出了接口业务逻辑相关的错误码,其他错误码详见 公共错误码。
| 错误码 | 描述 |
|---|---|
| FailedOperation.ActionLightDark | 光线太暗。 |
| FailedOperation.ActionLightStrong | 光线太强。 |
| FailedOperation.DownLoadError | 文件下载失败。 |
| FailedOperation.DownLoadTimeoutError | 文件下载超时。 |
| FailedOperation.ImageBlur | 图片模糊。 |
| FailedOperation.ImageDecodeFailed | 图片解码失败。 |
| FailedOperation.ImageSizeTooLarge | 图片尺寸过大。 |
| FailedOperation.LifePhotoDetectFake | 实人比对没通过。 |
| FailedOperation.LifePhotoSizeError | 传入图片过大或过小。 |
| FailedOperation.LivessDetectFail | 活体检测没通过。 |
| FailedOperation.LivessDetectFake | 疑似非真人录制。 |
| FailedOperation.LivessSystemError | 调用活体引擎接口出错。 |
| FailedOperation.LivessUnknownError | 视频实人检测没通过。 |
| FailedOperation.SilentDetectFail | 实人检测失败。 |
| FailedOperation.SilentFaceDetectFail | 视频未检测到人脸。 |
| FailedOperation.SilentFaceQualityFail | 视频中人脸质量低。 |
| FailedOperation.SilentMultiFaceFail | 视频检测中有多个人脸。 |
| FailedOperation.SilentPictureLiveFail | 疑似翻拍。 |
| FailedOperation.SilentThreshold | 实人检测未达到通过标准。 |
| InternalError.ActionLightDark | 光线太暗。 |
| InternalError.ActionLightStrong | 光线太强。 |
| InternalError.ActionNodetectFace | 未能检测到完整人脸。 |
| InternalError.CompareLowSimilarity | 比对相似度未达到通过标准。 |
| InternalError.LifePhotoPoorQuality | 传入图片分辨率太低,请重新上传。 |
| InternalError.LifePhotoSizeError | 传入图片过大或过小。 |
文档反馈