Skip to content

人脸比对(特征版)


接口描述

通过提取人脸的特征,计算两张人脸的相似度,从而判断是否是同一个人。

请求说明

HTTP 方法:

POST

请求 URL:

/ai-cloud-face/feature/recog/face1v1/v2

Header如下:

参数名称
Content-Typeapplication/json;charset=UTF-8

Body中放置请求参数,参数详情如下:

请求参数:

参数名称必填数据类型长度参数描述
firstCmdString1-32图片1固定传值 getFeature,必传
secondCmdString1-32图片2固定传值 getFeature,必传
firstImgString1-3000k图片1(base64 编码),原始图片大小需要小于 3M;
secondImgString1-3000k图片2(base64 编码),原始图片大小需要小于 3M;
firstRectString1-255图片1的人脸框,例如[{"x": 0,"y": 0,"height": 0,"width": 0}]
secondRectString1-255图片2的人脸框,例如[{"x": 0,"y": 0,"height": 0,"width": 0}]
busFlowIdString0-64业务流水号,业务系统唯一序列号(对账用,建议传入)

请求示例:

{
    "firstCmd": "getFeature",
    "secondCmd": "getFeature",
    "firstImg": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAIBAQ......",
    "secondImg": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAIBAQ......",
    "firstRect": "[{\"x\": 0,\"y\": 0,\"height\": 0,\"width\": 0}]",
    "secondRect": "[{\"x\": 0,\"y\": 0,\"height\": 0,\"width\": 0}]"
}

返回说明

返回参数:

返回值名称数据类型长度描述
codeString1-8返回结果,00000000表示成功
messageString1-255返回码描述
dataObject-返回的数据
-isSameBoolean1是否相似
-busFlowIdString1-64业务流水号,业务系统唯一序列号
-flowIdString1-64交易流水ID(建议保存)

返回示例:

{
    "code": "00000000",
    "message": "success",
    "success": true,
    "data": {
        "isSame": true
    }
}

是否仍需要帮助? 请保持联络!