主题
人脸比对(特征版)
接口描述
通过提取人脸的特征,计算两张人脸的相似度,从而判断是否是同一个人,并给出相似度评分,相似度越高,两张人脸为同一个人的概率越大。
请求说明
HTTP 方法:
POST
请求 URL:
/ai-cloud-face/feature/recog/face1v1
Header如下:
参数名称 | 值 |
---|---|
Content-Type | application/json;charset=UTF-8 |
Body中放置请求参数,参数详情如下:
请求参数:
参数名称 | 必填 | 数据类型 | 长度 | 参数描述 |
---|---|---|---|---|
firstCmd | 是 | String | 1-32 | 图片1固定传值 getFeature,必传 |
secondCmd | 是 | String | 1-32 | 图片2固定传值 getFeature,必传 |
firstImg | 是 | String | 1-3000k | 图片1(base64 编码),原始图片大小需要小于 3M; |
secondImg | 是 | String | 1-3000k | 图片2(base64 编码),原始图片大小需要小于 3M; |
firstRect | 是 | String | 1-255 | 图片1的人脸框,例如[{"x": 0,"y": 0,"height": 0,"width": 0}] |
secondRect | 是 | String | 1-255 | 图片2的人脸框,例如[{"x": 0,"y": 0,"height": 0,"width": 0}] |
busFlowId | 否 | String | 0-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}]"
}
返回说明
返回参数:
返回值名称 | 数据类型 | 长度 | 描述 |
---|---|---|---|
code | int | 1-8 | 返回结果,0表示成功 |
message | String | 1-255 | 返回码描述 |
data | Object | - | 返回的数据 |
-score | Double | 2,4 | 相似度 |
-busFlowId | String | 1-64 | 业务流水号,业务系统唯一序列号 |
-flowId | String | 1-64 | 交易流水ID(建议保存) |
返回示例:
{
"code": 0,
"message": "success",
"success": true,
"data": {
"score": 0.49
}
}
是否仍需要帮助? 请保持联络!