PersonGroupOperations class

Definition

PersonGroupOperations operations.

You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute.

PersonGroupOperations(client, config, serializer, deserializer)
Inheritance
builtins.object
PersonGroupOperations

Parameters

client

Client for service requests.

config

Configuration of service client.

serializer

An object model serializer.

deserializer

An object model deserializer.

Methods

create(person_group_id, name=None, user_data=None, recognition_model='recognition_01', custom_headers=None, raw=False, **operation_config)

Create a new person group with specified personGroupId, name, user-provided userData and recognitionModel.
A person group is the container of the uploaded person data, including face recognition features.
After creation, use PersonGroup Person - Create to add persons into the group, and then call PersonGroup - Train to get this group ready for Face - Identify.
No image will be stored. Only the person's extracted face features and userData will be stored on server until PersonGroup Person - Delete or PersonGroup - Delete 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 features in a person group can't be updated to features extracted by another version of recognition model.

  • 'recognition_01': The default recognition model for PersonGroup - Create. All those person groups created before 2019 March are bonded with this recognition model.
  • 'recognition_02': Recognition model released in 2019 March. 'recognition_02' is recommended since its overall accuracy is improved compared with 'recognition_01'. Person group quota:
  • 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 LargePersonGroup.
delete(person_group_id, custom_headers=None, raw=False, **operation_config)

Delete an existing person group. Persisted face features of all people in the person group will also be deleted.

get(person_group_id, return_recognition_model=False, custom_headers=None, raw=False, **operation_config)

Retrieve person group name, userData and recognitionModel. To get person information under this personGroup, use PersonGroup Person - List.

get_training_status(person_group_id, custom_headers=None, raw=False, **operation_config)

Retrieve the training status of a person group (completed or ongoing).

list(start=None, top=1000, return_recognition_model=False, custom_headers=None, raw=False, **operation_config)

List person groups’ personGroupId, name, userData and recognitionModel.

  • Person groups are stored in alphabetical order of personGroupId.
  • "start" parameter (string, optional) is a user-provided personGroupId value that returned entries have larger ids by string comparison. "start" set to empty to indicate return from the first item.
  • "top" parameter (int, optional) specifies the number of entries to return. A maximal of 1000 entries can be returned in one call. To fetch more, you can specify "start" with the last returned entry’s Id of the current call.
    For example, total 5 person groups: "group1", ..., "group5".
    "start=&top=" will return all 5 groups.
    "start=&top=2" will return "group1", "group2".
    "start=group2&top=3" will return "group3", "group4", "group5". .
train(person_group_id, custom_headers=None, raw=False, **operation_config)

Queue a person group training task, the training task may not be started immediately.

update(person_group_id, name=None, user_data=None, custom_headers=None, raw=False, **operation_config)

Update an existing person group's display name and userData. The properties which does not appear in request body will not be updated.

create(person_group_id, name=None, user_data=None, recognition_model='recognition_01', custom_headers=None, raw=False, **operation_config)

Create a new person group with specified personGroupId, name, user-provided userData and recognitionModel.
A person group is the container of the uploaded person data, including face recognition features.
After creation, use PersonGroup Person - Create to add persons into the group, and then call PersonGroup - Train to get this group ready for Face - Identify.
No image will be stored. Only the person's extracted face features and userData will be stored on server until PersonGroup Person - Delete or PersonGroup - Delete 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 features in a person group can't be updated to features extracted by another version of recognition model.

  • 'recognition_01': The default recognition model for PersonGroup - Create. All those person groups created before 2019 March are bonded with this recognition model.
  • 'recognition_02': Recognition model released in 2019 March. 'recognition_02' is recommended since its overall accuracy is improved compared with 'recognition_01'. Person group quota:
  • 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 LargePersonGroup.
create(person_group_id, name=None, user_data=None, recognition_model='recognition_01', custom_headers=None, raw=False, **operation_config)

Parameters

person_group_id
str

Id referencing a particular person group.

name
str

User defined name, maximum length is 128.

default value: None
user_data
str

User specified data. Length should not exceed 16KB.

default value: None
recognition_model
str or RecognitionModel

Possible values include: 'recognition_01', 'recognition_02'

default value: recognition_01
custom_headers
dict

headers that will be added to the request

default value: None
raw
bool

returns the direct response alongside the deserialized response

default value: False
operation_config

Operation configuration overrides.

Returns

None or ClientRawResponse if raw=true

Return type

Exceptions

delete(person_group_id, custom_headers=None, raw=False, **operation_config)

Delete an existing person group. Persisted face features of all people in the person group will also be deleted.

delete(person_group_id, custom_headers=None, raw=False, **operation_config)

Parameters

person_group_id
str

Id referencing a particular person group.

custom_headers
dict

headers that will be added to the request

default value: None
raw
bool

returns the direct response alongside the deserialized response

default value: False
operation_config

Operation configuration overrides.

Returns

None or ClientRawResponse if raw=true

Return type

Exceptions

get(person_group_id, return_recognition_model=False, custom_headers=None, raw=False, **operation_config)

Retrieve person group name, userData and recognitionModel. To get person information under this personGroup, use PersonGroup Person - List.

get(person_group_id, return_recognition_model=False, custom_headers=None, raw=False, **operation_config)

Parameters

person_group_id
str

Id referencing a particular person group.

return_recognition_model
bool

A value indicating whether the operation should return 'recognitionModel' in response.

default value: False
custom_headers
dict

headers that will be added to the request

default value: None
raw
bool

returns the direct response alongside the deserialized response

default value: False
operation_config

Operation configuration overrides.

Returns

PersonGroup or ClientRawResponse if raw=true

Return type

Exceptions

get_training_status(person_group_id, custom_headers=None, raw=False, **operation_config)

Retrieve the training status of a person group (completed or ongoing).

get_training_status(person_group_id, custom_headers=None, raw=False, **operation_config)

Parameters

person_group_id
str

Id referencing a particular person group.

custom_headers
dict

headers that will be added to the request

default value: None
raw
bool

returns the direct response alongside the deserialized response

default value: False
operation_config

Operation configuration overrides.

Returns

TrainingStatus or ClientRawResponse if raw=true

Return type

Exceptions

list(start=None, top=1000, return_recognition_model=False, custom_headers=None, raw=False, **operation_config)

List person groups’ personGroupId, name, userData and recognitionModel.

  • Person groups are stored in alphabetical order of personGroupId.
  • "start" parameter (string, optional) is a user-provided personGroupId value that returned entries have larger ids by string comparison. "start" set to empty to indicate return from the first item.
  • "top" parameter (int, optional) specifies the number of entries to return. A maximal of 1000 entries can be returned in one call. To fetch more, you can specify "start" with the last returned entry’s Id of the current call.
    For example, total 5 person groups: "group1", ..., "group5".
    "start=&top=" will return all 5 groups.
    "start=&top=2" will return "group1", "group2".
    "start=group2&top=3" will return "group3", "group4", "group5". .
list(start=None, top=1000, return_recognition_model=False, custom_headers=None, raw=False, **operation_config)

Parameters

start
str

List person groups from the least personGroupId greater than the "start".

default value: None
top
int

The number of person groups to list.

default value: 1000
return_recognition_model
bool

A value indicating whether the operation should return 'recognitionModel' in response.

default value: False
custom_headers
dict

headers that will be added to the request

default value: None
raw
bool

returns the direct response alongside the deserialized response

default value: False
operation_config

Operation configuration overrides.

Returns

list or ClientRawResponse if raw=true

Return type

Exceptions

train(person_group_id, custom_headers=None, raw=False, **operation_config)

Queue a person group training task, the training task may not be started immediately.

train(person_group_id, custom_headers=None, raw=False, **operation_config)

Parameters

person_group_id
str

Id referencing a particular person group.

custom_headers
dict

headers that will be added to the request

default value: None
raw
bool

returns the direct response alongside the deserialized response

default value: False
operation_config

Operation configuration overrides.

Returns

None or ClientRawResponse if raw=true

Return type

Exceptions

update(person_group_id, name=None, user_data=None, custom_headers=None, raw=False, **operation_config)

Update an existing person group's display name and userData. The properties which does not appear in request body will not be updated.

update(person_group_id, name=None, user_data=None, custom_headers=None, raw=False, **operation_config)

Parameters

person_group_id
str

Id referencing a particular person group.

name
str

User defined name, maximum length is 128.

default value: None
user_data
str

User specified data. Length should not exceed 16KB.

default value: None
custom_headers
dict

headers that will be added to the request

default value: None
raw
bool

returns the direct response alongside the deserialized response

default value: False
operation_config

Operation configuration overrides.

Returns

None or ClientRawResponse if raw=true

Return type

Exceptions

Attributes

models

models = <module 'azure.cognitiveservices.vision.face.models' from 'c:\\hostedtoolcache\\windows\\python\\3.6.8\\x64\\lib\\site-packages\\azure\\cognitiveservices\\vision\\face\\models\\__init__.py'>