最近更新时间:2021-03-12
1 功能描述
通过人脸检测和比对技术,识别出图片内出现的人物是否为国内娱乐明星。
调用地址:https://apim.unicloud.com/api/image/star/1.0.0/
请求方式:POST
返回类型:JSON
Header如下:
| 参数 | 值 | 说明 |
|---|---|---|
| Content-Type | multipart/form-data | -- |
| Authorization | Bearer | 参考Token获取 |
Body如下:
| 参数 | 是否必选 | 类型 | 可选值范围 | 说明 |
|---|---|---|---|---|
| image | true | string or file | - | 1、支持传图片URL或者直接post图片文件,不过两者不能混在同一请求中 2、只支持对静态图像的处理,如:png、jpg、jpeg、tif、webp,不支持动态图像的处理,如:gif 3、图片大小必须在1M以内,且建议对图片进行压缩处理,等比压缩到[256, 512]之间 |
注:Body是form-data格式
curl -k -H "Authorization:Bearer 2735fbc9-b797-31ad-812c-d8e9e903f6e3" \ -F 'image=@image_or_url' \ https://apim.unicloud.com/api/image/star/1.0.0/
curl -k -H "Authorization:Bearer 2735fbc9-b797-31ad-812c-d8e9e903f6e3" \ -F 'image=@image_or_url' \ https://apim.unicloud.com/api/image/star/1.0.0/
curl -k -H "Authorization:Bearer 2735fbc9-b797-31ad-812c-d8e9e903f6e3" -F 'image=@image_or_url' https://apim.unicloud.com/api/image/star/1.0.0/
| 字段 | 类型 | 说明 |
|---|---|---|
| data | object | 返回结果数据 |
| +objects | array | 检测出来的所有人脸 |
| ++facePosition | array | 检测到的人脸坐标信息 [左上角坐标,右上角坐标,右下角坐标,左下角坐标] |
| ++label | int | 搜索结果 -1:识别失败 0:明星人物 2:非明星人物 3:无人脸 |
| ++similarity | float | 与人物的相似度,范围在[0-1]之间,分值越高,越相似 |
| ++faceId | string | 最终给出相似人物的名字 |
| ++typeName | string | 最相似人物的所属类型名称 |
| code | int | 返回码 |
| message | string | 返回信息 |
{
"data": {
"objects": [
{
"facePosition": [
[
0.803858166649228,
0.039300969171903496
],
[
0.9261224837530226,
0.039300969171903496
],
[
0.9261224837530226,
0.14569213219599636
],
[
0.803858166649228,
0.14569213219599636
]
],
"similarity": 0.91219645738601685,
"typeName": "xxx",
"faceId": "YYY",
"label": 0
}
]
},
"code": 0,
"message": "success"
}{ "data": { "objects": [
{ "facePosition": [
[ 0.803858166649228, 0.039300969171903496
],
[ 0.9261224837530226, 0.039300969171903496
],
[ 0.9261224837530226, 0.14569213219599636
],
[ 0.803858166649228, 0.14569213219599636
]
], "similarity": 0.91219645738601685, "typeName": "xxx", "faceId": "YYY", "label": 0
}
]
}, "code": 0, "message": "success"}{
"data": {
"objects": [
{
"facePosition": [
[
0.803858166649228,
0.039300969171903496
],
[
0.9261224837530226,
0.039300969171903496
],
[
0.9261224837530226,
0.14569213219599636
],
[
0.803858166649228,
0.14569213219599636
]
],
"similarity": 0.91219645738601685,
"typeName": "xxx",
"faceId": "YYY",
"label": 0
}
]
},
"code": 0,
"message": "success"
}