Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate and implement Face SDK via TypeSpec #35384

Merged
Merged
Show file tree
Hide file tree
Changes from 41 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
f0b87e2
CodeGen from PR 27576 in Azure/azure-rest-api-specs
Apr 30, 2024
dae9679
Fix SDK error
zihyunting Apr 30, 2024
2673dbd
SDK Customization
zihyunting Apr 15, 2024
de6d3d9
test-resources.json
zihyunting Apr 3, 2024
dfc57f5
Samples
zihyunting Apr 15, 2024
a4016dd
Testcases
zihyunting Apr 3, 2024
931b3a6
Add SDK README.md
zihyunting Apr 30, 2024
d591f32
Rename the folder from samples/_shared to samples/shared
zihyunting May 3, 2024
5ee2b8b
Update the detection interface
zihyunting May 3, 2024
d71585f
Correct the comments in sample codes
zihyunting May 3, 2024
92a2fbf
Update the README.md
zihyunting May 3, 2024
0623a38
Update the interface of detect_from_url()
zihyunting May 3, 2024
9dc2109
Removed TODO tag
zihyunting May 3, 2024
8bd89ff
Update README.md
zihyunting May 6, 2024
91699a7
Correct the path of the model object
zihyunting May 6, 2024
66492d1
Refine liveness samples
zihyunting May 6, 2024
8d869d1
Reorganize samples and tests folder
zihyunting May 6, 2024
48920a7
Add assets.json
zihyunting May 7, 2024
0309e20
Update CHANGELOG and README
zihyunting May 7, 2024
05291d8
Fix errors reported by CI pipeline
zihyunting May 7, 2024
b27ccd2
Fix typo
zihyunting May 8, 2024
559c065
Fix tests error
zihyunting May 8, 2024
c2d6fa7
Update CHANGELOG and README
zihyunting May 9, 2024
6895791
Update customized operations
zihyunting May 9, 2024
8106b40
Update tests to fix test errors
zihyunting May 9, 2024
e7c81b7
Not support live tests for this preview release
zihyunting May 9, 2024
85554ab
Use `black` to reformat all samples and tests
zihyunting May 9, 2024
fba1d72
Merge branch 'main' into azure-ai-vision-face-test-cases-and-samples
zihyunting May 10, 2024
94c082f
Remove all ignore flag from samples
zihyunting May 10, 2024
d305e5b
Add pyproject.toml
zihyunting May 10, 2024
0bfae97
Regenerated code
zihyunting May 10, 2024
bd1f697
update patches
zihyunting May 10, 2024
22dbb02
fix samples
zihyunting May 10, 2024
f02131f
Update CHANGELOG
zihyunting May 10, 2024
29ab198
Regenerate SDK based on the latest TypeSpec
zihyunting May 13, 2024
8aae3af
Update customized method to address the TypeSpec changes
zihyunting May 13, 2024
d49f740
Update customized Enum classes definition and remove ignore flags fro…
zihyunting May 13, 2024
aeb6ee5
Update README.md
zihyunting May 13, 2024
26264e7
Fix pylint error
zihyunting May 13, 2024
6d4edec
Use the new name of AAD: 'Microsoft Entra ID'
zihyunting May 15, 2024
0f6d75e
Change the order of overload functions of
zihyunting May 15, 2024
168c21a
Re-format the code snippet in README.md
zihyunting May 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .vscode/cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -1775,6 +1775,29 @@
"wday",
"SNOMED"
]
},
{
"filename": "sdk/face/azure-ai-vision-face/**",
"words": [
"mros",
"Nify",
"ctxt",
"wday",
"faceid",
"facelistid",
"largefacelistid",
"persongroupid",
"largepersongroupid",
"dynamicpersongroupid",
"personid",
"maxnumofcandidatesreturned"
]
},
{
"filename": "sdk/face/azure-ai-vision-face/tests/**",
"words": [
"dcid"
]
}
],
"allowCompoundWords": true
Expand Down
31 changes: 31 additions & 0 deletions sdk/face/azure-ai-vision-face/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Release History

## 1.0.0b1 (Unreleased)

This is the first preview of the `azure-ai-vision-face` client library that follows the [Azure Python SDK Design Guidelines](https://azure.github.io/azure-sdk/python_design.html).
This library replaces the package [azure-cognitiveservices-vision-face](https://pypi.org/project/azure-cognitiveservices-vision-face/).

This package's [documentation](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/face/azure-ai-vision-face/) and [samples](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/face/azure-ai-vision-face/samples) demonstrate the new API.

### Features Added

- Added support for Liveness detection.
- Added support for `person` and `dynamic_person_group` operations.
- Added support for face recognition with `PersonDirectory` (`identify_from_person_directory()` and `identify_from_dynamic_person_group()`).
- Asynchronous APIs are added under `azure.ai.vision.face.aio` namespace.
- Authentication with Microsoft Entra ID is supported using `DefaultAzureCredential()` from `azure.identity`.

### Breaking Changes

- This library supports only the Azure AI Face v1.1-preview.1 API.
- The namespace/package name for Azure AI Face has changed from `azure.cognitiveservices.vision.face` to `azure.ai.vision.face`.
- Three client design:
- `FaceClient` to perform core Face functions such as face detection, recognition(identification and verification),
finding similar faces and grouping faces.
- `FaceAdministrationClient` to managed the following data structures that hold data on faces and persons for
Face recognition, like `face_list`, `large_face_list`, `person_group`, `large_person_group`, `person` and
`dynamic_person_group`.
- `FaceSessionClient` to interact with sessions which is used for Liveness detection.
- New function names that comply with [Azure Python SDK Design Guidelines](https://azure.github.io/azure-sdk/python_design.html):
- For example, the method `person_group_person.create()` is changed to `create_person_group_person()`.
- The Snapshot operations are all removed as [the Snapshot API is no longer supported](https://azure.microsoft.com/updates/facelimitedaccess/).
21 changes: 21 additions & 0 deletions sdk/face/azure-ai-vision-face/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Copyright (c) Microsoft Corporation.

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
8 changes: 8 additions & 0 deletions sdk/face/azure-ai-vision-face/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
include *.md
include LICENSE
include azure/ai/vision/face/py.typed
recursive-include tests *.py
recursive-include samples *.py *.md
include azure/__init__.py
include azure/ai/__init__.py
include azure/ai/vision/__init__.py
511 changes: 511 additions & 0 deletions sdk/face/azure-ai-vision-face/README.md

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions sdk/face/azure-ai-vision-face/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"commit": "37acfe2967e5e1be1169146ac461eb1875c9476e",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"typespec_src": "specification/ai/Face",
"@azure-tools/typespec-python": "0.23.8",
"@autorest/python": "6.13.15"
}
6 changes: 6 additions & 0 deletions sdk/face/azure-ai-vision-face/assets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "python",
"TagPrefix": "python/face/azure-ai-vision-face",
"Tag": "python/face/azure-ai-vision-face_6a3095279a"
}
1 change: 1 addition & 0 deletions sdk/face/azure-ai-vision-face/azure/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore
1 change: 1 addition & 0 deletions sdk/face/azure-ai-vision-face/azure/ai/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore
26 changes: 26 additions & 0 deletions sdk/face/azure-ai-vision-face/azure/ai/vision/face/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from ._patch import FaceClient
from ._client import FaceAdministrationClient
from ._patch import FaceSessionClient
from ._version import VERSION

__version__ = VERSION


from ._patch import patch_sdk as _patch_sdk

__all__ = [
"FaceClient",
"FaceAdministrationClient",
"FaceSessionClient",
]


_patch_sdk()
Loading