LargePersonGroupPersonOperations class

Definition

LargePersonGroupPersonOperations operations.

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

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

Parameters

client

Client for service requests.

config

Configuration of service client.

serializer

An object model serializer.

deserializer

An object model deserializer.

Methods

add_face_from_stream(large_person_group_id, person_id, image, user_data=None, target_face=None, detection_model='detection_01', custom_headers=None, raw=False, callback=None, **operation_config)

Add a face to a person into a large person group for face identification or verification. 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 LargePersonGroup PersonFace - Delete, LargePersonGroup Person - Delete or LargePersonGroup - Delete is called.
Note persistedFaceId is different from faceId generated by [Face

Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236).

  • 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.
  • Each person entry can hold up to 248 faces.
  • 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 person will be processed sequentially. Adding/deleting faces to/from different persons are processed 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 | Model | Recommended use-case(s) | | ---------- | -------- | | 'detection_01': | The default detection model for LargePersonGroup Person - Add Face. 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': | Detection model released in 2019 May with improved accuracy especially on small, side and blurry faces. >>|<<.
add_face_from_url(large_person_group_id, person_id, url, user_data=None, target_face=None, detection_model='detection_01', custom_headers=None, raw=False, **operation_config)

Add a face to a person into a large person group for face identification or verification. 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 LargePersonGroup PersonFace - Delete, LargePersonGroup Person - Delete or LargePersonGroup - Delete is called.
Note persistedFaceId is different from faceId generated by [Face

Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236).

  • 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.
  • Each person entry can hold up to 248 faces.
  • 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 person will be processed sequentially. Adding/deleting faces to/from different persons are processed 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 | Model | Recommended use-case(s) | | ---------- | -------- | | 'detection_01': | The default detection model for LargePersonGroup Person - Add Face. 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': | Detection model released in 2019 May with improved accuracy especially on small, side and blurry faces. >>|<<.
create(large_person_group_id, name=None, user_data=None, custom_headers=None, raw=False, **operation_config)

Create a new person in a specified large person group.

delete(large_person_group_id, person_id, custom_headers=None, raw=False, **operation_config)

Delete an existing person from a large person group. The persistedFaceId, userData, person name and face feature in the person entry will all be deleted.

delete_face(large_person_group_id, person_id, persisted_face_id, custom_headers=None, raw=False, **operation_config)

Delete a face from a person in a large person group by specified largePersonGroupId, personId and persistedFaceId.
Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from different persons are processed in parallel.

get(large_person_group_id, person_id, custom_headers=None, raw=False, **operation_config)

Retrieve a person's name and userData, and the persisted faceIds representing the registered person face feature.

get_face(large_person_group_id, person_id, persisted_face_id, custom_headers=None, raw=False, **operation_config)

Retrieve information about a persisted face (specified by persistedFaceId, personId and its belonging largePersonGroupId).

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

List all persons in a large person group, and retrieve person information (including personId, name, userData and persistedFaceIds of registered faces of the person).

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

Update name or userData of a person.

update_face(large_person_group_id, person_id, persisted_face_id, user_data=None, custom_headers=None, raw=False, **operation_config)

Update a person persisted face's userData field.

add_face_from_stream(large_person_group_id, person_id, image, user_data=None, target_face=None, detection_model='detection_01', custom_headers=None, raw=False, callback=None, **operation_config)

Add a face to a person into a large person group for face identification or verification. 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 LargePersonGroup PersonFace - Delete, LargePersonGroup Person - Delete or LargePersonGroup - Delete is called.
Note persistedFaceId is different from faceId generated by [Face

Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236).

  • 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.
  • Each person entry can hold up to 248 faces.
  • 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 person will be processed sequentially. Adding/deleting faces to/from different persons are processed 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 | Model | Recommended use-case(s) | | ---------- | -------- | | 'detection_01': | The default detection model for LargePersonGroup Person - Add Face. 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': | Detection model released in 2019 May with improved accuracy especially on small, side and blurry faces. >>|<<.
add_face_from_stream(large_person_group_id, person_id, image, user_data=None, target_face=None, detection_model='detection_01', custom_headers=None, raw=False, callback=None, **operation_config)

Parameters

large_person_group_id
str

Id referencing a particular large person group.

person_id
str

Id referencing a particular person.

image
Generator

An image stream.

user_data
str

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

default value: None
target_face
list[int]

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.

default value: None
detection_model
str or 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. Possible values include: 'detection_01', 'detection_02'

default value: detection_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
callback
Callable[Bytes, response=None]

When specified, will be called with each chunk of data that is streamed. The callback should take two arguments, the bytes of the current chunk of data and the response object. If the data is uploading, response will be None.

default value: None
operation_config

Operation configuration overrides.

Returns

PersistedFace or ClientRawResponse if raw=true

Return type

Exceptions

add_face_from_url(large_person_group_id, person_id, url, user_data=None, target_face=None, detection_model='detection_01', custom_headers=None, raw=False, **operation_config)

Add a face to a person into a large person group for face identification or verification. 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 LargePersonGroup PersonFace - Delete, LargePersonGroup Person - Delete or LargePersonGroup - Delete is called.
Note persistedFaceId is different from faceId generated by [Face

Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236).

  • 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.
  • Each person entry can hold up to 248 faces.
  • 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 person will be processed sequentially. Adding/deleting faces to/from different persons are processed 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 | Model | Recommended use-case(s) | | ---------- | -------- | | 'detection_01': | The default detection model for LargePersonGroup Person - Add Face. 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': | Detection model released in 2019 May with improved accuracy especially on small, side and blurry faces. >>|<<.
add_face_from_url(large_person_group_id, person_id, url, user_data=None, target_face=None, detection_model='detection_01', custom_headers=None, raw=False, **operation_config)

Parameters

large_person_group_id
str

Id referencing a particular large person group.

person_id
str

Id referencing a particular person.

url
str

Publicly reachable URL of an image

user_data
str

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

default value: None
target_face
list[int]

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.

default value: None
detection_model
str or 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. Possible values include: 'detection_01', 'detection_02'

default value: detection_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

PersistedFace or ClientRawResponse if raw=true

Return type

Exceptions

create(large_person_group_id, name=None, user_data=None, custom_headers=None, raw=False, **operation_config)

Create a new person in a specified large person group.

create(large_person_group_id, name=None, user_data=None, custom_headers=None, raw=False, **operation_config)

Parameters

large_person_group_id
str

Id referencing a particular large 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

Person or ClientRawResponse if raw=true

Return type

Exceptions

delete(large_person_group_id, person_id, custom_headers=None, raw=False, **operation_config)

Delete an existing person from a large person group. The persistedFaceId, userData, person name and face feature in the person entry will all be deleted.

delete(large_person_group_id, person_id, custom_headers=None, raw=False, **operation_config)

Parameters

large_person_group_id
str

Id referencing a particular large person group.

person_id
str

Id referencing a particular person.

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_face(large_person_group_id, person_id, persisted_face_id, custom_headers=None, raw=False, **operation_config)

Delete a face from a person in a large person group by specified largePersonGroupId, personId and persistedFaceId.
Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from different persons are processed in parallel.

delete_face(large_person_group_id, person_id, persisted_face_id, custom_headers=None, raw=False, **operation_config)

Parameters

large_person_group_id
str

Id referencing a particular large person group.

person_id
str

Id referencing a particular person.

persisted_face_id
str

Id referencing a particular persistedFaceId of an existing face.

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(large_person_group_id, person_id, custom_headers=None, raw=False, **operation_config)

Retrieve a person's name and userData, and the persisted faceIds representing the registered person face feature.

get(large_person_group_id, person_id, custom_headers=None, raw=False, **operation_config)

Parameters

large_person_group_id
str

Id referencing a particular large person group.

person_id
str

Id referencing a particular person.

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

Person or ClientRawResponse if raw=true

Return type

Exceptions

get_face(large_person_group_id, person_id, persisted_face_id, custom_headers=None, raw=False, **operation_config)

Retrieve information about a persisted face (specified by persistedFaceId, personId and its belonging largePersonGroupId).

get_face(large_person_group_id, person_id, persisted_face_id, custom_headers=None, raw=False, **operation_config)

Parameters

large_person_group_id
str

Id referencing a particular large person group.

person_id
str

Id referencing a particular person.

persisted_face_id
str

Id referencing a particular persistedFaceId of an existing face.

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

PersistedFace or ClientRawResponse if raw=true

Return type

Exceptions

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

List all persons in a large person group, and retrieve person information (including personId, name, userData and persistedFaceIds of registered faces of the person).

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

Parameters

large_person_group_id
str

Id referencing a particular large person group.

start
str

Starting person id to return (used to list a range of persons).

default value: None
top
int

Number of persons to return starting with the person id indicated by the 'start' parameter.

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

list or ClientRawResponse if raw=true

Return type

Exceptions

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

Update name or userData of a person.

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

Parameters

large_person_group_id
str

Id referencing a particular large person group.

person_id
str

Id referencing a particular person.

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

update_face(large_person_group_id, person_id, persisted_face_id, user_data=None, custom_headers=None, raw=False, **operation_config)

Update a person persisted face's userData field.

update_face(large_person_group_id, person_id, persisted_face_id, user_data=None, custom_headers=None, raw=False, **operation_config)

Parameters

large_person_group_id
str

Id referencing a particular large person group.

person_id
str

Id referencing a particular person.

persisted_face_id
str

Id referencing a particular persistedFaceId of an existing face.

user_data
str

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

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'>