Person Group Operations - Create Person Group

Create a new Person Group with specified personGroupId, name, user-provided userData and recognitionModel.
A Person Group is a container holding the uploaded person data, including face recognition features.

After creation, use "Create Person Group Person" to add persons into the group, and then call "Train Person Group" to get this group ready for "Identify From Person Group".

No image will be stored. Only the person's extracted face feature(s) and userData will be stored on server until "Delete Person Group Person" or "Delete Person Group" is called.

'recognitionModel' should be specified to associate with this Person Group. The default value for 'recognitionModel' is 'recognition_01', if the latest model needed, please explicitly specify the model you need in this parameter. New faces that are added to an existing Person Group will use the recognition model that's already associated with the collection. Existing face feature(s) in a Person Group can't be updated to features extracted by another version of recognition model.

Note

    • Free-tier subscription quota: 1,000 Person Groups. Each holds up to 1,000 persons.
    • S0-tier subscription quota: 1,000,000 Person Groups. Each holds up to 10,000 persons.
    • to handle larger scale face identification problem, please consider using Large Person Group.
PUT {endpoint}/face/{apiVersion}/persongroups/{personGroupId}

URI Parameters

Name In Required Type Description
apiVersion
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).

personGroupId
path True

string

ID of the container.

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

Request Body

Name Required Type Description
name True

string

User defined name, maximum length is 128.

recognitionModel

RecognitionModel

The 'recognitionModel' associated with this face list. Supported 'recognitionModel' values include 'recognition_01', 'recognition_02, 'recognition_03', and 'recognition_04'. The default value is 'recognition_01'. 'recognition_04' is recommended since its accuracy is improved on faces wearing masks compared with 'recognition_03', and its overall accuracy is improved compared with 'recognition_01' and 'recognition_02'.

userData

string

Optional user defined data. Length should not exceed 16K.

Responses

Name Type Description
200 OK

The request has succeeded.

Other Status Codes

FaceErrorResponse

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

Create PersonGroup

Sample Request

PUT {endpoint}/face/v1.1-preview.1/persongroups/your_person_group_id

{
  "name": "your_person_group_name",
  "userData": "your_user_data",
  "recognitionModel": "recognition_01"
}

Sample Response

Definitions

Name Description
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.

FaceErrorResponse

A response containing error details.

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

FaceError

The error object.