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