You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Regenerate SDK with the latest TypeSpec
* Remove samples and tests which are related to `FaceAdministrationClient`
* Update README.md and CHANGLOG.md
* Update test recordings
Copy file name to clipboardExpand all lines: sdk/face/azure-ai-vision-face/CHANGELOG.md
+6-9Lines changed: 6 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,21 +10,18 @@ This package's [documentation](https://github.com/Azure/azure-sdk-for-python/tre
10
10
### Features Added
11
11
12
12
- Added support for Liveness detection.
13
-
- Added support for `person` and `dynamic_person_group` operations.
14
-
- Added support for face recognition with `PersonDirectory` (`identify_from_person_directory()` and `identify_from_dynamic_person_group()`).
15
13
- Asynchronous APIs are added under `azure.ai.vision.face.aio` namespace.
16
14
- Authentication with Microsoft Entra ID is supported using `DefaultAzureCredential()` from `azure.identity`.
17
15
18
16
### Breaking Changes
19
17
20
-
- This library supports only the Azure AI Face v1.1-preview.1 API.
18
+
- This library only supports the API of the the operation groups below of [Azure AI Face v1.1-preview.1](https://learn.microsoft.com/rest/api/face/operation-groups?view=rest-face-v1.1-preview.1):
19
+
- Face Detection Operations
20
+
- Face Recognition Operations: only `Find Similiar`, `Group` and `Verify Face To Face`.
21
+
- Liveness Session Operations
21
22
- The namespace/package name for Azure AI Face has changed from `azure.cognitiveservices.vision.face` to `azure.ai.vision.face`.
22
-
- Three client design:
23
-
-`FaceClient` to perform core Face functions such as face detection, recognition(identification and verification),
24
-
finding similar faces and grouping faces.
25
-
-`FaceAdministrationClient` to managed the following data structures that hold data on faces and persons for
26
-
Face recognition, like `face_list`, `large_face_list`, `person_group`, `large_person_group`, `person` and
27
-
`dynamic_person_group`.
23
+
- Two client design:
24
+
-`FaceClient` to perform core Face functions such as face detection, verification, finding similar faces and grouping faces.
28
25
-`FaceSessionClient` to interact with sessions which is used for Liveness detection.
29
26
- New function names that comply with [Azure Python SDK Design Guidelines](https://azure.github.io/azure-sdk/python_design.html):
30
27
- For example, the method `person_group_person.create()` is changed to `create_person_group_person()`.
- Finding similar faces from a smaller set of faces that look similar to the target face.
131
130
- Grouping faces into several smaller groups based on similarity.
132
131
133
-
### FaceAdministrationClient
134
-
135
-
`FaceAdministrationClient` is provided to interact with the following data structures that hold data on faces and
136
-
persons for Face recognition:
137
-
138
-
-`person`: It is a container that holds faces and is used by face recognition. It can either not belong to any group or be a member of multiple `dynamic_person_group` simultaneously.
139
-
- Each person can have up to 248 faces, and the total number of persons can reach 75 million.
140
-
- For [face verification][face_verification], call `verify_from_person_directory()`.
141
-
- For [face identification][face_identification], training is not needed before calling `identify_from_person_directory()`.
142
-
- See [Use the PersonDirectory structure][use_person_directory_structure] to get more information.
143
-
-`dynamic_person_group`: It is a group that can hold several `person`, and is used by face identification.
144
-
- The total `dynamic_person_group` is unlimited.
145
-
- Training is not needed before calling `identify_from_dynamic_person_group()`.
146
-
- See [Use the PersonDirectory structure][use_person_directory_structure] to get more information.
147
-
-`face_list`: It is a list of faces and used by [find similar faces][find_similar] (call `find_similar_from_face_list()`).
148
-
- It can up to 1,000 faces.
149
-
-`large_face_list`: It is a list of faces which can hold more faces and used by [find similar faces][find_similar].
150
-
- It can up to 1,000,000 faces.
151
-
- Training (`begin_train_large_face_list()`) is required before calling `find_similar_from_large_face_list()`.
152
-
-`person_group`: It is a container that store the uploaded person data, including their face recognition features, and is used by face recognition.
153
-
- It can up to 10,000 persons, with each person capable of holding up to 248 faces.
154
-
- For [face verification][face_verification], call `verify_from_person_group()`.
155
-
- For [face identification][face_identification], training (`begin_train_person_group()`) is required before calling `identify_from_person_group()`.
156
-
-`large_person_group`: It is a container which can hold more persons, and is used by face recognition.
157
-
- It can up to 1,000,000 persons, with each person capable of holding up to 248 faces. The total persons in all `large_person_group` should not exceed 1,000,000,000.
158
-
- For [face verification][face_verification], call `verify_from_large_person_group()`.
159
-
- For [face identification][face_identification], training (`begin_train_large_person_group()`) is required before calling `identify_from_large_person_group()`.
160
132
161
133
### FaceSessionClient
162
134
@@ -166,24 +138,12 @@ persons for Face recognition:
166
138
- Query the liveness and verification result.
167
139
- Query the audit result.
168
140
169
-
### Long-running operations
170
-
171
-
Long-running operations are operations which consist of an initial request sent to the service to start an operation,
172
-
followed by polling the service at intervals to determine whether the operation has completed or failed, and if it has
173
-
succeeded, to get the result.
174
-
175
-
Methods that train a group (LargeFaceList, PersonGroup or LargePersonGroup), create/delete a Person/DynamicPersonGroup,
176
-
add a face or delete a face from a Person are modeled as long-running operations.
177
-
The client exposes a `begin_<method-name>` method that returns an `LROPoller` or `AsyncLROPoller`. Callers should wait
178
-
for the operation to complete by calling `result()` on the poller object returned from the `begin_<method-name>` method.
179
-
Sample code snippets are provided to illustrate using long-running operations [below](#examples"Examples").
180
141
181
142
## Examples
182
143
183
144
The following section provides several code snippets covering some of the most common Face tasks, including:
184
145
185
146
*[Detecting faces in an image](#face-detection"Face Detection")
186
-
*[Identifying the specific face from a LargePersonGroup](#face-recognition-from-largepersongroup"Face Recognition from LargePersonGroup")
187
147
*[Determining if a face in an video is real (live) or fake (spoof)](#liveness-detection"Liveness Detection")
188
148
189
149
### Face Detection
@@ -231,103 +191,6 @@ with FaceClient(endpoint=endpoint, credential=AzureKeyCredential(key)) as face_c
231
191
print(f"Face: {face.as_dict()}")
232
192
```
233
193
234
-
### Face Recognition from LargePersonGroup
235
-
Identify a face against a defined LargePersonGroup.
236
-
237
-
First, we have to use `FaceAdministrationClient` to create a `LargePersonGroup`, add a few `Person` to it,
238
-
and then register faces with these `Person`.
239
-
240
-
```python
241
-
from azure.core.credentials import AzureKeyCredential
242
-
from azure.ai.vision.face import FaceAdministrationClient, FaceClient
243
-
from azure.ai.vision.face.models import FaceDetectionModel, FaceRecognitionModel
244
-
245
-
246
-
defread_file_content(file_path: str):
247
-
withopen(file_path, "rb") as fd:
248
-
file_content = fd.read()
249
-
250
-
return file_content
251
-
252
-
253
-
endpoint ="<your endpoint>"
254
-
key ="<your api key>"
255
-
256
-
large_person_group_id ="lpg_family"
257
-
258
-
with FaceAdministrationClient(endpoint=endpoint, credential=AzureKeyCredential(key)) as face_admin_client:
259
-
print(f"Create a large person group with id: {large_person_group_id}")
0 commit comments