Face – Verify
驗證兩張臉是屬于同一個人還是一張臉屬于某一個人。
Remarks:
* API用于正面或接近正面
* 對于對準確度敏感的場景,請自行判斷
Http Method
`POST`
Request URL
`https://api.cognitive.azure.cn/face/v1.0/verify`
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 | Type | Description |
| --- | --- | --- |
| faceId1 | String | Face - Detect創建的一個face 的 faceid |
| faceId2 | String | Face - Detect創建的另一個一個face 的 faceid |
臉對人驗證請求主體中的JSON字段
| Fields | Type | Description |
| --- | --- | --- |
| faceId | String | 一個人臉的faceId, 來自Face - Detect |
| personGroupId | String | 使用現有的personGroupId和personId快速加載指定的人員。personGroupId在Person Group - Create a Person Group中創建 |
| personId| String | 指定person group中的某個人。personId是在“ Person - Create a Person”中創建的 |
~~~
{
"faceId":"c5c24a82-6845-4031-9d5d-978df9175426",
"personId":"815df99c-598f-4926-930a-a734b3fd651c",
"personGroupId":"sample_group"
}
~~~
Response 200
請求成功返回驗證結果
JSON fields in response body:
| Fields | Type | Description |
| --- | --- | --- |
| isIdentical | Boolean | 如果兩個人臉屬于同一個人或這個人臉屬于該人,則為真,否則為false |
| confidence | Number | 數字表示兩個面孔是否屬于同一個人的相似性置信度,或者人臉是否屬于該人。默認情況下,如果相似度置信度大于或等于0.5,則isIdentical設置為True。這對于高級用戶重寫“isIdentical”并對其自己的數據進行微調是有用的。 |
~~~
{
"isIdentical":true,
"confidence":0.9
}
~~~
Response 400
rror code and message returned in JSON:
| Error Code | Error Message Description |
| --- | --- |
| BadArgument |錯誤和未被解析出來的的JSON主體 |
| BadArgument | Face ID無效。faceId1,faceId2或faceId是無效的,有效的faceId來自Face - Detect |
| BadArgument | Person ID無效。有效personId是從Person - Create a Person的現有人員生成的|
| BadArgument | 請求正文無效 |
| BadArgument | Person group ID無效。有效格式應該是由數字組成的字符串,英文字母小寫,' - ','_',并且不超過64個字符 |
~~~
{
"error":{
"code":"BadArgument",
"message":"Request body is invalid."
}
}
~~~
Response 401
JSON中返回的錯誤代碼和消息
| Error Code | Error Message Description |
| --- | --- |
| Unspecified | Invalid subscription Key or user/plan is blocked |
~~~
{
"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
~~~
{
"error":{
"statusCode": 403,
"message": "Out of call volume quota. Quota will be replenished in 2.12 days."
}
}
~~~
Response 404
Error code and message returned in JSON
| Error Code | Error Message Description |
| --- | --- |
| FaceNotFound | 面找不到。faceId已過期或不存在 |
| PersonNotFound | Person沒有找到 |
| PersonGroupNotFound | Person Group沒找到|
~~~
{
"error":{
"code":"PersonGroupNotFound",
"message":"Person group 'sample_group' is not found."
}
}
~~~
Response 415
不支持的媒介類型錯誤。只有“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