Large Face List - Add Face From Url

Add a face to a specified large face list, up to 1,000,000 faces.
To deal with an image contains 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 will be stored on server until LargeFaceList Face - Delete or LargeFaceList - Delete is called.
Note persistedFaceId is different from faceId generated by Face - 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 Face - 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.
  • Adding/deleting faces to/from a same face list are processed sequentially and to/from different face lists are in parallel.
  • 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 How to specify a detection model

Quota:

  • 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/v1.0/largefacelists/{largeFaceListId}/persistedfaces
POST {Endpoint}/face/v1.0/largefacelists/{largeFaceListId}/persistedfaces?userData={userData}&targetFace={targetFace}&detectionModel={detectionModel}

URI Parameters

Name In Required Type Description
Endpoint
path True

string

Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com).

largeFaceListId
path True

string

Id referencing a particular large face list.

Regex pattern: ^[a-z0-9-_]+$

detectionModel
query

DetectionModel

Name of detection model. Detection model is used to detect faces in the submitted image. A detection model name can be provided when performing Face - Detect or (Large)FaceList - Add Face or (Large)PersonGroup - Add Face. The default value is 'detection_01', if another model is needed, please explicitly specify it.

targetFace
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". E.g. "targetFace=10,10,100,100". If there is more than one face in the image, targetFace is required to specify which face to add. No targetFace means there is only one face detected in the entire image.

userData
query

string

User-specified data about the face for any purpose. The maximum length is 1KB.

Request Header

Name Required Type Description
Ocp-Apim-Subscription-Key True

string

Request Body

Name Required Type Description
url True

string

Publicly reachable URL of an image

Responses

Name Type Description
200 OK

PersistedFace

A successful call returns a new persistedFaceId.

Other Status Codes

APIError

Error response.

Security

Ocp-Apim-Subscription-Key

Type: apiKey
In: header

Examples

Create large face list face example

Sample Request

POST {Endpoint}/face/v1.0/largefacelists/sample_face_list/persistedfaces?userData={Customized user data}&targetFace=10,10,100,100&detectionModel=detection_01


{
  "url": "{Image Url here}"
}

Sample Response

{
  "persistedFaceId": "B8D802CF-DD8F-4E61-B15C-9E6C5844CCBA"
}

Definitions

Name Description
APIError

Error information returned by the API

DetectionModel

Name of detection model. Detection model is used to detect faces in the submitted image. A detection model name can be provided when performing Face - Detect or (Large)FaceList - Add Face or (Large)PersonGroup - Add Face. The default value is 'detection_01', if another model is needed, please explicitly specify it.

Error

Error body.

ImageUrl
PersistedFace

PersonFace object.

APIError

Error information returned by the API

Name Type Description
error

Error

Error body.

DetectionModel

Name of detection model. Detection model is used to detect faces in the submitted image. A detection model name can be provided when performing Face - Detect or (Large)FaceList - Add Face or (Large)PersonGroup - Add Face. The default value is 'detection_01', if another model is needed, please explicitly specify it.

Name Type Description
detection_01

string

detection_02

string

detection_03

string

Error

Error body.

Name Type Description
code

string

message

string

ImageUrl

Name Type Description
url

string

Publicly reachable URL of an image

PersistedFace

PersonFace object.

Name Type Description
persistedFaceId

string

The persistedFaceId of the target face, which is persisted and will not expire. Different from faceId created by Face - Detect and will expire in at the time specified by faceIdTimeToLive after the detection call.

userData

string

User-provided data attached to the face. The size limit is 1KB.