Face - Group
根据脸部相似性将候选人脸分成组。
* 输出一个或多个不连贯的face groups和一个messyGroup。Face groups包含具有相似外观的脸部,通常是同一个人。人脸组按照组中的人脸数量排列。在结果中,属于同一人的面孔可能会被分成多个组。
* MessyGroup是一个特殊的脸部组,其中包含无法从原始脸部找到任何类似对象脸部的脸部。如果所有面都找到对应的,messyGroup将不会出现在结果中。
* Group API至少需要2个最多1000选人脸。当您只有2个候选面孔时,我们建议尝试Face - Verify方法 。
Http Method
`POST`
Request URL
`https://api.cognitive.azure.cn/face/v1.0/group`
Request headers
| 请求头部 |类型 | 描述 |
| --- | --- | --- |
| Content-Type(可选) | string | Media type of the body sent to the API |
| Ocp-Apim-Subscription-Key | string | Subscription key which provides access to this API. Found in your Cognitive Services accounts. |
Request body
JSON fields in request body:
| 字段 |类型 |描述 |
| --- | --- | --- |
| faceIds | Array | (Face - Detect创建的候选faceId数组。最多是1000个) |
~~~
{
"faceIds":[
"c5c24a82-6845-4031-9d5d-978df9175426",
"015839fb-fbd9-4f79-ace9-7675fc2f1dd9",
"65d083d4-9447-47d1-af30-b626144bf0fb",
"fce92aed-d578-4d2e-8114-068f8af4492e",
"30ea1073-cc9e-4652-b1e3-d08fb7b95315",
"be386ab3-af91-4104-9e6d-4dae4c9fddb7",
"fbd2a038-dbff-452c-8e79-2ee81b1aa84e",
"b64d5e15-8257-4af2-b20a-5a750f8940e7"
]
}
~~~
Response 200
请求成功将返回一个或多个相似面孔组(按组数量大小排序)和一个messyGroup。
JSON fields in response body:
| Fields | Type | Description |
| --- | --- | --- |
| Groups | Array | 基于脸部相似性的原始脸部分组。组是按照人数量排名的 |
| messyGroup | Array | 在原始面部数据里没有找到的任何相似的面部id数组 |
~~~
{
"groups": [
[
"c5c24a82-6845-4031-9d5d-978df9175426",
"015839fb-fbd9-4f79-ace9-7675fc2f1dd9",
"fce92aed-d578-4d2e-8114-068f8af4492e",
"b64d5e15-8257-4af2-b20a-5a750f8940e7"
],
[
"65d083d4-9447-47d1-af30-b626144bf0fb",
"30ea1073-cc9e-4652-b1e3-d08fb7b95315"
]
],
"messyGroup": [
"be386ab3-af91-4104-9e6d-4dae4c9fddb7"
]
}
~~~
Response 400
Error code and message returned in JSON
| Error Code | Error Message Description |
| --- | --- |
| BadArgument | 无效的请求正文 |
| BadArgument | 查找到的数据不在[1,1000]范围内|
| FaceNotFound | 当前面部数据未定)|
~~~
{
"error":{
"code":"BadArgument",
"message":"Request body is invalid."
}
}
~~~
Response 401
Error code and message returned in JSON
| Error Code |Error Message Description |
| --- | --- |
| Unspecified | 无效的 subscription Key或user/plan被冻结|
~~~
{
"error":{
"code": "Unspecified",
"message": "Access denied due to invalid subscription key. Make sure you are subscribed to an API you are trying to call and provide the right key."
}
}
~~~
Response 403
超出容量,容量将会在2.12天内扩充
~~~
{
"error":{
"statusCode": 403,
"message": "Out of call volume quota. Quota will be replenished in 2.12 days."
}
}
~~~
Response 415
Unsupported media type error. Only "application/json" is valid for this API.
不支持的媒体类型错误。只有“application / json”对这个API有效。
~~~
{
"error":{
"code":"BadArgument",
"message":"Invalid Media Type"
}
}
~~~
Response 429
~~~
{
"error":{
"statusCode": 429,
"message": "Rate limit is exceeded. Try again in 26 seconds."
}
}
~~~
- 空白目录
- Face
- Detect
- Find Similar
- Group
- Identify
- Verify
- Face List
- Add a Face to a Face List
- Create a Face List
- Delete a Face from a Face List
- Delete a Face List
- Get a Face List
- List Face Lists
- Update a Face List
- Person
- Add a Person Face
- Create a Person
- Delete a Person
- Delete a Person Face
- Get a Person
- Get a Person Face
- List Persons in a Person Group
- Update a Person
- Update a Person Face
- Person Group
- Create a Person Group
- Delete a Person Group
- Get a Person Group
- Get Person Group Training Status
- List Person Groups
- Train Person Group
- Update a Person Group