Face List Operations - Add Large Face List Face
Add a face to a specified Large Face List, up to 1,000,000 faces.
To deal with an image containing multiple faces, input face can be specified as an image with a targetFace rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted face feature(s) will be stored on server until "Delete Large Face List Face" or "Delete Large Face List" is called.
Note that persistedFaceId is different from faceId generated by "Detect".
-
- Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger.
- JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB.
- "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face successfully.
- Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause failures.
- The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size.
- Different 'detectionModel' values can be provided. To use and compare different detection models, please refer to here.
Note
-
- Free-tier subscription quota: 1,000 faces per Large Face List.
- S0-tier subscription quota: 1,000,000 faces per Large Face List.
POST {endpoint}/face/{apiVersion}/largefacelists/{largeFaceListId}/persistedfaces
POST {endpoint}/face/{apiVersion}/largefacelists/{largeFaceListId}/persistedfaces?_overload=addLargeFaceListFace&targetFace={targetFace}&detectionModel={detectionModel}&userData={userData}
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
api
|
path | True |
string |
API Version |
endpoint
|
path | True |
string uri |
Supported Cognitive Services endpoints (protocol and hostname, for example: https://{resource-name}.cognitiveservices.azure.com). |
large
|
path | True |
string |
Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. Regex pattern: |
detection
|
query |
The 'detectionModel' associated with the detected faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default value is 'detection_01'. |
||
target
|
query |
integer[] |
A face rectangle to specify the target face to be added to a person, in the format of 'targetFace=left,top,width,height'. |
|
user
|
query |
string |
User-provided data attached to the face. The size limit is 1K. |
Request Body
Media Types: "application/octet-stream"
Name | Type | Description |
---|---|---|
imageContent |
string |
The image to be analyzed |
Responses
Name | Type | Description |
---|---|---|
200 OK |
A successful call returns a new persistedFaceId. |
|
Other Status Codes |
An unexpected error response. Headers x-ms-error-code: string |
Security
Ocp-Apim-Subscription-Key
The secret key for your Azure AI Face subscription.
Type:
apiKey
In:
header
AADToken
The Azure Active Directory OAuth2 Flow
Type:
oauth2
Flow:
accessCode
Authorization URL:
https://api.example.com/oauth2/authorize
Token URL:
https://api.example.com/oauth2/token
Scopes
Name | Description |
---|---|
https://cognitiveservices.azure.com/.default |
Examples
Add Face to LargeFaceList
Sample request
POST {endpoint}/face/v1.2-preview.1/largefacelists/your_large_face_list_id/persistedfaces?_overload=addLargeFaceListFace&targetFace=10,10,100,100&detectionModel=detection_01&userData=your_user_data
"<your-image-bytes-here>"
Sample response
{
"persistedFaceId": "43897a75-8d6f-42cf-885e-74832febb055"
}
Definitions
Name | Description |
---|---|
Add |
Response body for adding face. |
Detection |
The 'detectionModel' associated with the detected faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default value is 'detection_01'. |
Face |
The error object. For comprehensive details on error codes and messages returned by the Face Service, please refer to the following link: https://aka.ms/face-error-codes-and-messages. |
Face |
A response containing error details. |
AddFaceResult
Response body for adding face.
Name | Type | Description |
---|---|---|
persistedFaceId |
string |
Persisted Face ID of the added face, which is persisted and will not expire. Different from faceId which is created in "Detect" and will expire in 24 hours after the detection call. |
DetectionModel
The 'detectionModel' associated with the detected faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default value is 'detection_01'.
Name | Type | Description |
---|---|---|
detection_01 |
string |
The default detection model. Recommend for near frontal face detection. For scenarios with exceptionally large angle (head-pose) faces, occluded faces or wrong image orientation, the faces in such cases may not be detected. |
detection_02 |
string |
Detection model released in 2019 May with improved accuracy especially on small, side and blurry faces. |
detection_03 |
string |
Detection model released in 2021 February with improved accuracy especially on small faces. |
FaceError
The error object. For comprehensive details on error codes and messages returned by the Face Service, please refer to the following link: https://aka.ms/face-error-codes-and-messages.
Name | Type | Description |
---|---|---|
code |
string |
One of a server-defined set of error codes. |
message |
string |
A human-readable representation of the error. |
FaceErrorResponse
A response containing error details.
Name | Type | Description |
---|---|---|
error |
The error object. |