diff --git a/sdk/face/azure-ai-vision-face/_meta.json b/sdk/face/azure-ai-vision-face/_meta.json index ebf0ddcdb2f0..4370f7c53014 100644 --- a/sdk/face/azure-ai-vision-face/_meta.json +++ b/sdk/face/azure-ai-vision-face/_meta.json @@ -1,7 +1,6 @@ { - "commit": "37acfe2967e5e1be1169146ac461eb1875c9476e", + "commit": "0e268a0c63dbabfc740047673fe160411090415a", "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" + "@azure-tools/typespec-python": "0.36.1" } \ No newline at end of file diff --git a/sdk/face/azure-ai-vision-face/azure/ai/vision/face/__init__.py b/sdk/face/azure-ai-vision-face/azure/ai/vision/face/__init__.py index fb2a4f6ec76e..5aeddc1bce27 100644 --- a/sdk/face/azure-ai-vision-face/azure/ai/vision/face/__init__.py +++ b/sdk/face/azure-ai-vision-face/azure/ai/vision/face/__init__.py @@ -5,15 +5,25 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._client import FaceAdministrationClient -from ._patch import FaceClient -from ._patch import FaceSessionClient +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._client import FaceAdministrationClient # type: ignore +from ._client import FaceClient # type: ignore +from ._client import FaceSessionClient # type: ignore from ._version import VERSION __version__ = VERSION - +try: + from ._patch import __all__ as _patch_all + from ._patch import * +except ImportError: + _patch_all = [] from ._patch import patch_sdk as _patch_sdk __all__ = [ @@ -21,6 +31,6 @@ "FaceClient", "FaceSessionClient", ] - +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/face/azure-ai-vision-face/azure/ai/vision/face/_model_base.py b/sdk/face/azure-ai-vision-face/azure/ai/vision/face/_model_base.py index 9d401b0cf012..e6a2730f9276 100644 --- a/sdk/face/azure-ai-vision-face/azure/ai/vision/face/_model_base.py +++ b/sdk/face/azure-ai-vision-face/azure/ai/vision/face/_model_base.py @@ -5,7 +5,7 @@ # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- -# pylint: disable=protected-access, arguments-differ, signature-differs, broad-except, too-many-lines +# pylint: disable=protected-access, broad-except import copy import calendar @@ -574,7 +574,7 @@ def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: def copy(self) -> "Model": return Model(self.__dict__) - def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: # pylint: disable=unused-argument + def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: if f"{cls.__module__}.{cls.__qualname__}" not in cls._calculated: # we know the last nine classes in mro are going to be 'Model', '_MyMutableMapping', 'MutableMapping', # 'Mapping', 'Collection', 'Sized', 'Iterable', 'Container' and 'object' @@ -585,8 +585,8 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: # pylint: di annotations = { k: v for mro_class in mros - if hasattr(mro_class, "__annotations__") # pylint: disable=no-member - for k, v in mro_class.__annotations__.items() # pylint: disable=no-member + if hasattr(mro_class, "__annotations__") + for k, v in mro_class.__annotations__.items() } for attr, rf in attr_to_rest_field.items(): rf._module = cls.__module__ @@ -601,8 +601,8 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: # pylint: di def __init_subclass__(cls, discriminator: typing.Optional[str] = None) -> None: for base in cls.__bases__: - if hasattr(base, "__mapping__"): # pylint: disable=no-member - base.__mapping__[discriminator or cls.__name__] = cls # type: ignore # pylint: disable=no-member + if hasattr(base, "__mapping__"): + base.__mapping__[discriminator or cls.__name__] = cls # type: ignore @classmethod def _get_discriminator(cls, exist_discriminators) -> typing.Optional["_RestField"]: @@ -613,7 +613,7 @@ def _get_discriminator(cls, exist_discriminators) -> typing.Optional["_RestField @classmethod def _deserialize(cls, data, exist_discriminators): - if not hasattr(cls, "__mapping__"): # pylint: disable=no-member + if not hasattr(cls, "__mapping__"): return cls(data) discriminator = cls._get_discriminator(exist_discriminators) if discriminator is None: @@ -633,7 +633,7 @@ def _deserialize(cls, data, exist_discriminators): discriminator_value = data.find(xml_name).text # pyright: ignore else: discriminator_value = data.get(discriminator._rest_name) - mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore # pylint: disable=no-member + mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore return mapped_cls._deserialize(data, exist_discriminators) def as_dict(self, *, exclude_readonly: bool = False) -> typing.Dict[str, typing.Any]: diff --git a/sdk/face/azure-ai-vision-face/azure/ai/vision/face/_patch.py b/sdk/face/azure-ai-vision-face/azure/ai/vision/face/_patch.py index 98b897fa68e2..f7dd32510333 100644 --- a/sdk/face/azure-ai-vision-face/azure/ai/vision/face/_patch.py +++ b/sdk/face/azure-ai-vision-face/azure/ai/vision/face/_patch.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines # ------------------------------------ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. @@ -7,309 +6,9 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import Any, IO, List, Optional, Union, overload +from typing import List -from azure.core.tracing.decorator import distributed_trace - -from . import models as _models -from ._client import FaceClient as FaceClientGenerated -from ._client import FaceSessionClient as FaceSessionClientGenerated -from .operations._operations import JSON, _Unset - - -class FaceClient(FaceClientGenerated): - """FaceClient. - - :param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example: - https://{resource-name}.cognitiveservices.azure.com). Required. - :type endpoint: str - :param credential: Credential used to authenticate requests to the service. Is either a - AzureKeyCredential type or a TokenCredential type. Required. - :type credential: ~azure.core.credentials.AzureKeyCredential or - ~azure.core.credentials.TokenCredential - :keyword api_version: API Version. Default value is "v1.2-preview.1". Note that overriding this - default value may result in unsupported behavior. - :paramtype api_version: str or ~azure.ai.vision.face.models.Versions - """ - - @overload - def detect_from_url( - self, - *, - url: str, - content_type: str = "application/json", - detection_model: Union[str, _models.FaceDetectionModel], - recognition_model: Union[str, _models.FaceRecognitionModel], - return_face_id: bool, - return_face_attributes: Optional[List[Union[str, _models.FaceAttributeType]]] = None, - return_face_landmarks: Optional[bool] = None, - return_recognition_model: Optional[bool] = None, - face_id_time_to_live: Optional[int] = None, - **kwargs: Any, - ) -> List[_models.FaceDetectionResult]: ... - - @overload - def detect_from_url( - self, - body: JSON, - *, - content_type: str = "application/json", - detection_model: Union[str, _models.FaceDetectionModel], - recognition_model: Union[str, _models.FaceRecognitionModel], - return_face_id: bool, - return_face_attributes: Optional[List[Union[str, _models.FaceAttributeType]]] = None, - return_face_landmarks: Optional[bool] = None, - return_recognition_model: Optional[bool] = None, - face_id_time_to_live: Optional[int] = None, - **kwargs: Any, - ) -> List[_models.FaceDetectionResult]: ... - - @overload - def detect_from_url( - self, - body: IO[bytes], - *, - content_type: str = "application/json", - detection_model: Union[str, _models.FaceDetectionModel], - recognition_model: Union[str, _models.FaceRecognitionModel], - return_face_id: bool, - return_face_attributes: Optional[List[Union[str, _models.FaceAttributeType]]] = None, - return_face_landmarks: Optional[bool] = None, - return_recognition_model: Optional[bool] = None, - face_id_time_to_live: Optional[int] = None, - **kwargs: Any, - ) -> List[_models.FaceDetectionResult]: ... - - @distributed_trace - def detect_from_url( - self, - body: Union[JSON, IO[bytes]] = _Unset, - *, - url: str = _Unset, - detection_model: Union[str, _models.FaceDetectionModel], - recognition_model: Union[str, _models.FaceRecognitionModel], - return_face_id: bool, - return_face_attributes: Optional[List[Union[str, _models.FaceAttributeType]]] = None, - return_face_landmarks: Optional[bool] = None, - return_recognition_model: Optional[bool] = None, - face_id_time_to_live: Optional[int] = None, - **kwargs: Any, - ) -> List[_models.FaceDetectionResult]: - """Detect human faces in an image, return face rectangles, and optionally with faceIds, landmarks, - and attributes. - - Please refer to - https://learn.microsoft.com/rest/api/face/face-detection-operations/detect-from-url for more - details. - - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] - :keyword url: URL of input image. Required. - :paramtype url: str - :keyword detection_model: The 'detectionModel' associated with the detected faceIds. Supported - 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default - value is 'detection_01'. 'detection_03' is recommended since its accuracy is improved on - smaller faces (64x64 pixels) and rotated face orientations. Known values are: "detection_01", - "detection_02", and "detection_03". Default value is None. - :paramtype detection_model: str or ~azure.ai.vision.face.models.FaceDetectionModel - :keyword recognition_model: The 'recognitionModel' associated with the detected faceIds. - Supported 'recognitionModel' values include 'recognition_01', 'recognition_02', - 'recognition_03' or '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'. Known values are: "recognition_01", "recognition_02", "recognition_03", and - "recognition_04". Default value is None. - :paramtype recognition_model: str or ~azure.ai.vision.face.models.FaceRecognitionModel - :keyword return_face_id: Return faceIds of the detected faces or not. The default value is - true. Default value is None. - :paramtype return_face_id: bool - :keyword return_face_attributes: Analyze and return the one or more specified face attributes - in the comma-separated string like 'returnFaceAttributes=headPose,glasses'. Face attribute - analysis has additional computational and time cost. Default value is None. - :paramtype return_face_attributes: list[str or ~azure.ai.vision.face.models.FaceAttributeType] - :keyword return_face_landmarks: Return face landmarks of the detected faces or not. The default - value is false. Default value is None. - :paramtype return_face_landmarks: bool - :keyword return_recognition_model: Return 'recognitionModel' or not. The default value is - false. This is only applicable when returnFaceId = true. Default value is None. - :paramtype return_recognition_model: bool - :keyword face_id_time_to_live: The number of seconds for the face ID being cached. Supported - range from 60 seconds up to 86400 seconds. The default value is 86400 (24 hours). Default value - is None. - :paramtype face_id_time_to_live: int - :return: list of FaceDetectionResult - :rtype: list[~azure.ai.vision.face.models.FaceDetectionResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - return super()._detect_from_url( - body, - url=url, - detection_model=detection_model, - recognition_model=recognition_model, - return_face_id=return_face_id, - return_face_attributes=return_face_attributes, - return_face_landmarks=return_face_landmarks, - return_recognition_model=return_recognition_model, - face_id_time_to_live=face_id_time_to_live, - **kwargs, - ) - - @distributed_trace - def detect( - self, - image_content: bytes, - *, - detection_model: Union[str, _models.FaceDetectionModel], - recognition_model: Union[str, _models.FaceRecognitionModel], - return_face_id: bool, - return_face_attributes: Optional[List[Union[str, _models.FaceAttributeType]]] = None, - return_face_landmarks: Optional[bool] = None, - return_recognition_model: Optional[bool] = None, - face_id_time_to_live: Optional[int] = None, - **kwargs: Any, - ) -> List[_models.FaceDetectionResult]: - """Detect human faces in an image, return face rectangles, and optionally with faceIds, landmarks, - and attributes. - - Please refer to https://learn.microsoft.com/rest/api/face/face-detection-operations/detect for - more details. - - :param image_content: The input image binary. Required. - :type image_content: bytes - :keyword detection_model: The 'detectionModel' associated with the detected faceIds. Supported - 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default - value is 'detection_01'. 'detection_03' is recommended since its accuracy is improved on - smaller faces (64x64 pixels) and rotated face orientations. Known values are: "detection_01", - "detection_02", and "detection_03". Default value is None. - :paramtype detection_model: str or ~azure.ai.vision.face.models.FaceDetectionModel - :keyword recognition_model: The 'recognitionModel' associated with the detected faceIds. - Supported 'recognitionModel' values include 'recognition_01', 'recognition_02', - 'recognition_03' or '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'. Known values are: "recognition_01", "recognition_02", "recognition_03", and - "recognition_04". Default value is None. - :paramtype recognition_model: str or ~azure.ai.vision.face.models.FaceRecognitionModel - :keyword return_face_id: Return faceIds of the detected faces or not. The default value is - true. Default value is None. - :paramtype return_face_id: bool - :keyword return_face_attributes: Analyze and return the one or more specified face attributes - in the comma-separated string like 'returnFaceAttributes=headPose,glasses'. Face attribute - analysis has additional computational and time cost. Default value is None. - :paramtype return_face_attributes: list[str or ~azure.ai.vision.face.models.FaceAttributeType] - :keyword return_face_landmarks: Return face landmarks of the detected faces or not. The default - value is false. Default value is None. - :paramtype return_face_landmarks: bool - :keyword return_recognition_model: Return 'recognitionModel' or not. The default value is - false. This is only applicable when returnFaceId = true. Default value is None. - :paramtype return_recognition_model: bool - :keyword face_id_time_to_live: The number of seconds for the face ID being cached. Supported - range from 60 seconds up to 86400 seconds. The default value is 86400 (24 hours). Default value - is None. - :paramtype face_id_time_to_live: int - :return: list of FaceDetectionResult - :rtype: list[~azure.ai.vision.face.models.FaceDetectionResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - return super()._detect( - image_content, - detection_model=detection_model, - recognition_model=recognition_model, - return_face_id=return_face_id, - return_face_attributes=return_face_attributes, - return_face_landmarks=return_face_landmarks, - return_recognition_model=return_recognition_model, - face_id_time_to_live=face_id_time_to_live, - **kwargs, - ) - - def __enter__(self) -> "FaceClient": - super().__enter__() - return self - - -class FaceSessionClient(FaceSessionClientGenerated): - """FaceSessionClient. - - :param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example: - https://{resource-name}.cognitiveservices.azure.com). Required. - :type endpoint: str - :param credential: Credential used to authenticate requests to the service. Is either a - AzureKeyCredential type or a TokenCredential type. Required. - :type credential: ~azure.core.credentials.AzureKeyCredential or - ~azure.core.credentials.TokenCredential - :keyword api_version: API Version. Default value is "v1.2-preview.1". Note that overriding this - default value may result in unsupported behavior. - :paramtype api_version: str or ~azure.ai.vision.face.models.Versions - """ - - @overload - def create_liveness_with_verify_session( - self, - body: _models.CreateLivenessWithVerifySessionContent, - *, - verify_image: Union[bytes, None], - content_type: str = "application/json", - **kwargs: Any, - ) -> _models.CreateLivenessWithVerifySessionResult: ... - - @overload - def create_liveness_with_verify_session( - self, - body: JSON, - *, - verify_image: Union[bytes, None], - content_type: str = "application/json", - **kwargs: Any, - ) -> _models.CreateLivenessWithVerifySessionResult: ... - - @distributed_trace - def create_liveness_with_verify_session( - self, - body: Union[_models.CreateLivenessWithVerifySessionContent, JSON], - *, - verify_image: Union[bytes, None], - **kwargs: Any, - ) -> _models.CreateLivenessWithVerifySessionResult: - """Create a new liveness session with verify. Client device submits VerifyImage during the - /detectLivenessWithVerify/singleModal call. - - Please refer to - https://learn.microsoft.com/rest/api/face/liveness-session-operations/create-liveness-with-verify-session - for more details. - - :param body: Body parameter. Is one of the following types: - CreateLivenessWithVerifySessionContent, JSON, IO[bytes] Required. - :type body: ~azure.ai.vision.face.models.CreateLivenessWithVerifySessionContent or JSON or - IO[bytes] - :return: CreateLivenessWithVerifySessionResult. The CreateLivenessWithVerifySessionResult is - compatible with MutableMapping - :rtype: ~azure.ai.vision.face.models.CreateLivenessWithVerifySessionResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - if verify_image is not None: - if not isinstance(body, _models.CreateLivenessWithVerifySessionContent): - # Convert body to CreateLivenessWithVerifySessionContent if necessary - body = _models.CreateLivenessWithVerifySessionContent(**body) - request_body = ( - _models._models.CreateLivenessWithVerifySessionMultipartContent( # pylint: disable=protected-access - parameters=body, - verify_image=("verify-image", verify_image), - ) - ) - return super()._create_liveness_with_verify_session_with_verify_image(request_body, **kwargs) - - return super()._create_liveness_with_verify_session(body, **kwargs) - - def __enter__(self) -> "FaceSessionClient": - super().__enter__() - return self - - -__all__: List[str] = [ - "FaceClient", - "FaceSessionClient", -] # Add all objects you want publicly available to users at this package level +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/face/azure-ai-vision-face/azure/ai/vision/face/_serialization.py b/sdk/face/azure-ai-vision-face/azure/ai/vision/face/_serialization.py index 7b3074215a30..ce17d1798ce7 100644 --- a/sdk/face/azure-ai-vision-face/azure/ai/vision/face/_serialization.py +++ b/sdk/face/azure-ai-vision-face/azure/ai/vision/face/_serialization.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # -------------------------------------------------------------------------- # # Copyright (c) Microsoft Corporation. All rights reserved. @@ -226,7 +227,7 @@ class _FixedOffset(datetime.tzinfo): # type: ignore :param datetime.timedelta offset: offset in timedelta format """ - def __init__(self, offset): + def __init__(self, offset) -> None: self.__offset = offset def utcoffset(self, dt): @@ -506,7 +507,6 @@ def _flatten_subtype(cls, key, objects): def _classify(cls, response, objects): """Check the class _subtype_map for any child classes. We want to ignore any inherited _subtype_maps. - Remove the polymorphic key from the initial data. :param dict response: The initial data :param dict objects: The class objects @@ -518,7 +518,7 @@ def _classify(cls, response, objects): if not isinstance(response, ET.Element): rest_api_response_key = cls._get_rest_key_parts(subtype_key)[-1] - subtype_value = response.pop(rest_api_response_key, None) or response.pop(subtype_key, None) + subtype_value = response.get(rest_api_response_key, None) or response.get(subtype_key, None) else: subtype_value = xml_key_extractor(subtype_key, cls._attribute_map[subtype_key], response) if subtype_value: @@ -598,7 +598,7 @@ class Serializer(object): # pylint: disable=too-many-public-methods "multiple": lambda x, y: x % y != 0, } - def __init__(self, classes: Optional[Mapping[str, type]] = None): + def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: self.serialize_type = { "iso-8601": Serializer.serialize_iso, "rfc-1123": Serializer.serialize_rfc, @@ -1452,7 +1452,7 @@ class Deserializer(object): valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") - def __init__(self, classes: Optional[Mapping[str, type]] = None): + def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: self.deserialize_type = { "iso-8601": Deserializer.deserialize_iso, "rfc-1123": Deserializer.deserialize_rfc, diff --git a/sdk/face/azure-ai-vision-face/azure/ai/vision/face/aio/__init__.py b/sdk/face/azure-ai-vision-face/azure/ai/vision/face/aio/__init__.py index 5bd65820f8fe..36a989211ffa 100644 --- a/sdk/face/azure-ai-vision-face/azure/ai/vision/face/aio/__init__.py +++ b/sdk/face/azure-ai-vision-face/azure/ai/vision/face/aio/__init__.py @@ -5,12 +5,22 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._client import FaceAdministrationClient -from ._patch import FaceClient -from ._patch import FaceSessionClient +from typing import TYPE_CHECKING +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import +from ._client import FaceAdministrationClient # type: ignore +from ._client import FaceClient # type: ignore +from ._client import FaceSessionClient # type: ignore + +try: + from ._patch import __all__ as _patch_all + from ._patch import * +except ImportError: + _patch_all = [] from ._patch import patch_sdk as _patch_sdk __all__ = [ @@ -18,6 +28,6 @@ "FaceClient", "FaceSessionClient", ] - +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/face/azure-ai-vision-face/azure/ai/vision/face/aio/_patch.py b/sdk/face/azure-ai-vision-face/azure/ai/vision/face/aio/_patch.py index 430ddc352d01..f7dd32510333 100644 --- a/sdk/face/azure-ai-vision-face/azure/ai/vision/face/aio/_patch.py +++ b/sdk/face/azure-ai-vision-face/azure/ai/vision/face/aio/_patch.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines # ------------------------------------ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. @@ -7,309 +6,9 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import Any, IO, List, Optional, Union, overload +from typing import List -from azure.core.tracing.decorator_async import distributed_trace_async - -from .. import models as _models -from ._client import FaceClient as FaceClientGenerated -from ._client import FaceSessionClient as FaceSessionClientGenerated -from .operations._operations import JSON, _Unset - - -class FaceClient(FaceClientGenerated): - """FaceClient. - - :param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example: - https://{resource-name}.cognitiveservices.azure.com). Required. - :type endpoint: str - :param credential: Credential used to authenticate requests to the service. Is either a - AzureKeyCredential type or a TokenCredential type. Required. - :type credential: ~azure.core.credentials.AzureKeyCredential or - ~azure.core.credentials_async.AsyncTokenCredential - :keyword api_version: API Version. Default value is "v1.2-preview.1". Note that overriding this - default value may result in unsupported behavior. - :paramtype api_version: str or ~azure.ai.vision.face.models.Versions - """ - - @overload - async def detect_from_url( - self, - *, - url: str, - content_type: str = "application/json", - detection_model: Union[str, _models.FaceDetectionModel], - recognition_model: Union[str, _models.FaceRecognitionModel], - return_face_id: bool, - return_face_attributes: Optional[List[Union[str, _models.FaceAttributeType]]] = None, - return_face_landmarks: Optional[bool] = None, - return_recognition_model: Optional[bool] = None, - face_id_time_to_live: Optional[int] = None, - **kwargs: Any, - ) -> List[_models.FaceDetectionResult]: ... - - @overload - async def detect_from_url( - self, - body: JSON, - *, - content_type: str = "application/json", - detection_model: Union[str, _models.FaceDetectionModel], - recognition_model: Union[str, _models.FaceRecognitionModel], - return_face_id: bool, - return_face_attributes: Optional[List[Union[str, _models.FaceAttributeType]]] = None, - return_face_landmarks: Optional[bool] = None, - return_recognition_model: Optional[bool] = None, - face_id_time_to_live: Optional[int] = None, - **kwargs: Any, - ) -> List[_models.FaceDetectionResult]: ... - - @overload - async def detect_from_url( - self, - body: IO[bytes], - *, - content_type: str = "application/json", - detection_model: Union[str, _models.FaceDetectionModel], - recognition_model: Union[str, _models.FaceRecognitionModel], - return_face_id: bool, - return_face_attributes: Optional[List[Union[str, _models.FaceAttributeType]]] = None, - return_face_landmarks: Optional[bool] = None, - return_recognition_model: Optional[bool] = None, - face_id_time_to_live: Optional[int] = None, - **kwargs: Any, - ) -> List[_models.FaceDetectionResult]: ... - - @distributed_trace_async - async def detect_from_url( - self, - body: Union[JSON, IO[bytes]] = _Unset, - *, - url: str = _Unset, - detection_model: Union[str, _models.FaceDetectionModel], - recognition_model: Union[str, _models.FaceRecognitionModel], - return_face_id: bool, - return_face_attributes: Optional[List[Union[str, _models.FaceAttributeType]]] = None, - return_face_landmarks: Optional[bool] = None, - return_recognition_model: Optional[bool] = None, - face_id_time_to_live: Optional[int] = None, - **kwargs: Any, - ) -> List[_models.FaceDetectionResult]: - """Detect human faces in an image, return face rectangles, and optionally with faceIds, landmarks, - and attributes. - - Please refer to - https://learn.microsoft.com/rest/api/face/face-detection-operations/detect-from-url for more - details. - - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] - :keyword url: URL of input image. Required. - :paramtype url: str - :keyword detection_model: The 'detectionModel' associated with the detected faceIds. Supported - 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default - value is 'detection_01'. 'detection_03' is recommended since its accuracy is improved on - smaller faces (64x64 pixels) and rotated face orientations. Known values are: "detection_01", - "detection_02", and "detection_03". Default value is None. - :paramtype detection_model: str or ~azure.ai.vision.face.models.FaceDetectionModel - :keyword recognition_model: The 'recognitionModel' associated with the detected faceIds. - Supported 'recognitionModel' values include 'recognition_01', 'recognition_02', - 'recognition_03' or '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'. Known values are: "recognition_01", "recognition_02", "recognition_03", and - "recognition_04". Default value is None. - :paramtype recognition_model: str or ~azure.ai.vision.face.models.FaceRecognitionModel - :keyword return_face_id: Return faceIds of the detected faces or not. The default value is - true. Default value is None. - :paramtype return_face_id: bool - :keyword return_face_attributes: Analyze and return the one or more specified face attributes - in the comma-separated string like 'returnFaceAttributes=headPose,glasses'. Face attribute - analysis has additional computational and time cost. Default value is None. - :paramtype return_face_attributes: list[str or ~azure.ai.vision.face.models.FaceAttributeType] - :keyword return_face_landmarks: Return face landmarks of the detected faces or not. The default - value is false. Default value is None. - :paramtype return_face_landmarks: bool - :keyword return_recognition_model: Return 'recognitionModel' or not. The default value is - false. This is only applicable when returnFaceId = true. Default value is None. - :paramtype return_recognition_model: bool - :keyword face_id_time_to_live: The number of seconds for the face ID being cached. Supported - range from 60 seconds up to 86400 seconds. The default value is 86400 (24 hours). Default value - is None. - :paramtype face_id_time_to_live: int - :return: list of FaceDetectionResult - :rtype: list[~azure.ai.vision.face.models.FaceDetectionResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - return await super()._detect_from_url( - body, - url=url, - detection_model=detection_model, - recognition_model=recognition_model, - return_face_id=return_face_id, - return_face_attributes=return_face_attributes, - return_face_landmarks=return_face_landmarks, - return_recognition_model=return_recognition_model, - face_id_time_to_live=face_id_time_to_live, - **kwargs, - ) - - @distributed_trace_async - async def detect( - self, - image_content: bytes, - *, - detection_model: Union[str, _models.FaceDetectionModel], - recognition_model: Union[str, _models.FaceRecognitionModel], - return_face_id: bool, - return_face_attributes: Optional[List[Union[str, _models.FaceAttributeType]]] = None, - return_face_landmarks: Optional[bool] = None, - return_recognition_model: Optional[bool] = None, - face_id_time_to_live: Optional[int] = None, - **kwargs: Any, - ) -> List[_models.FaceDetectionResult]: - """Detect human faces in an image, return face rectangles, and optionally with faceIds, landmarks, - and attributes. - - Please refer to https://learn.microsoft.com/rest/api/face/face-detection-operations/detect for - more details. - - :param image_content: The input image binary. Required. - :type image_content: bytes - :keyword detection_model: The 'detectionModel' associated with the detected faceIds. Supported - 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default - value is 'detection_01'. 'detection_03' is recommended since its accuracy is improved on - smaller faces (64x64 pixels) and rotated face orientations. Known values are: "detection_01", - "detection_02", and "detection_03". Default value is None. - :paramtype detection_model: str or ~azure.ai.vision.face.models.FaceDetectionModel - :keyword recognition_model: The 'recognitionModel' associated with the detected faceIds. - Supported 'recognitionModel' values include 'recognition_01', 'recognition_02', - 'recognition_03' or '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'. Known values are: "recognition_01", "recognition_02", "recognition_03", and - "recognition_04". Default value is None. - :paramtype recognition_model: str or ~azure.ai.vision.face.models.FaceRecognitionModel - :keyword return_face_id: Return faceIds of the detected faces or not. The default value is - true. Default value is None. - :paramtype return_face_id: bool - :keyword return_face_attributes: Analyze and return the one or more specified face attributes - in the comma-separated string like 'returnFaceAttributes=headPose,glasses'. Face attribute - analysis has additional computational and time cost. Default value is None. - :paramtype return_face_attributes: list[str or ~azure.ai.vision.face.models.FaceAttributeType] - :keyword return_face_landmarks: Return face landmarks of the detected faces or not. The default - value is false. Default value is None. - :paramtype return_face_landmarks: bool - :keyword return_recognition_model: Return 'recognitionModel' or not. The default value is - false. This is only applicable when returnFaceId = true. Default value is None. - :paramtype return_recognition_model: bool - :keyword face_id_time_to_live: The number of seconds for the face ID being cached. Supported - range from 60 seconds up to 86400 seconds. The default value is 86400 (24 hours). Default value - is None. - :paramtype face_id_time_to_live: int - :return: list of FaceDetectionResult - :rtype: list[~azure.ai.vision.face.models.FaceDetectionResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - return await super()._detect( - image_content, - detection_model=detection_model, - recognition_model=recognition_model, - return_face_id=return_face_id, - return_face_attributes=return_face_attributes, - return_face_landmarks=return_face_landmarks, - return_recognition_model=return_recognition_model, - face_id_time_to_live=face_id_time_to_live, - **kwargs, - ) - - async def __aenter__(self) -> "FaceClient": - await super().__aenter__() - return self - - -class FaceSessionClient(FaceSessionClientGenerated): - """FaceSessionClient. - - :param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example: - https://{resource-name}.cognitiveservices.azure.com). Required. - :type endpoint: str - :param credential: Credential used to authenticate requests to the service. Is either a - AzureKeyCredential type or a TokenCredential type. Required. - :type credential: ~azure.core.credentials.AzureKeyCredential or - ~azure.core.credentials_async.AsyncTokenCredential - :keyword api_version: API Version. Default value is "v1.2-preview.1". Note that overriding this - default value may result in unsupported behavior. - :paramtype api_version: str or ~azure.ai.vision.face.models.Versions - """ - - @overload - async def create_liveness_with_verify_session( - self, - body: _models.CreateLivenessSessionContent, - *, - verify_image: Union[bytes, None], - content_type: str = "application/json", - **kwargs: Any, - ) -> _models.CreateLivenessWithVerifySessionResult: ... - - @overload - async def create_liveness_with_verify_session( - self, - body: JSON, - *, - verify_image: Union[bytes, None], - content_type: str = "application/json", - **kwargs: Any, - ) -> _models.CreateLivenessWithVerifySessionResult: ... - - @distributed_trace_async - async def create_liveness_with_verify_session( - self, - body: Union[_models.CreateLivenessWithVerifySessionContent, JSON], - *, - verify_image: Union[bytes, None], - **kwargs: Any, - ) -> _models.CreateLivenessWithVerifySessionResult: - """Create a new liveness session with verify. Client device submits VerifyImage during the - /detectLivenessWithVerify/singleModal call. - - Please refer to - https://learn.microsoft.com/rest/api/face/liveness-session-operations/create-liveness-with-verify-session - for more details. - - :param body: Body parameter. Is one of the following types: - CreateLivenessWithVerifySessionContent, JSON, IO[bytes] Required. - :type body: ~azure.ai.vision.face.models.CreateLivenessWithVerifySessionContent or JSON or - IO[bytes] - :return: CreateLivenessWithVerifySessionResult. The CreateLivenessWithVerifySessionResult is - compatible with MutableMapping - :rtype: ~azure.ai.vision.face.models.CreateLivenessWithVerifySessionResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - if verify_image is not None: - if not isinstance(body, _models.CreateLivenessWithVerifySessionContent): - # Convert body to CreateLivenessWithVerifySessionContent if necessary - body = _models.CreateLivenessWithVerifySessionContent(**body) - request_body = ( - _models._models.CreateLivenessWithVerifySessionMultipartContent( # pylint: disable=protected-access - parameters=body, - verify_image=("verify-image", verify_image), - ) - ) - return await super()._create_liveness_with_verify_session_with_verify_image(request_body, **kwargs) - - return await super()._create_liveness_with_verify_session(body, **kwargs) - - async def __aenter__(self) -> "FaceSessionClient": - await super().__aenter__() - return self - - -__all__: List[str] = [ - "FaceClient", - "FaceSessionClient", -] # Add all objects you want publicly available to users at this package level +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/face/azure-ai-vision-face/azure/ai/vision/face/aio/operations/__init__.py b/sdk/face/azure-ai-vision-face/azure/ai/vision/face/aio/operations/__init__.py index d69ac05180a1..b51ef2b0b13a 100644 --- a/sdk/face/azure-ai-vision-face/azure/ai/vision/face/aio/operations/__init__.py +++ b/sdk/face/azure-ai-vision-face/azure/ai/vision/face/aio/operations/__init__.py @@ -5,14 +5,20 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._operations import LargeFaceListOperations -from ._operations import LargePersonGroupOperations -from ._operations import FaceClientOperationsMixin -from ._operations import FaceSessionClientOperationsMixin +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import LargeFaceListOperations # type: ignore +from ._operations import LargePersonGroupOperations # type: ignore +from ._operations import FaceClientOperationsMixin # type: ignore +from ._operations import FaceSessionClientOperationsMixin # type: ignore from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ @@ -21,5 +27,5 @@ "FaceClientOperationsMixin", "FaceSessionClientOperationsMixin", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/face/azure-ai-vision-face/azure/ai/vision/face/models/__init__.py b/sdk/face/azure-ai-vision-face/azure/ai/vision/face/models/__init__.py index 420ac616cabd..bd27ef5dd21a 100644 --- a/sdk/face/azure-ai-vision-face/azure/ai/vision/face/models/__init__.py +++ b/sdk/face/azure-ai-vision-face/azure/ai/vision/face/models/__init__.py @@ -5,84 +5,88 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._models import AccessoryItem -from ._models import AddFaceResult -from ._models import AuditLivenessResponseInfo -from ._models import AuditRequestInfo -from ._models import BlurProperties -from ._models import CreateLivenessSessionContent -from ._models import CreateLivenessSessionResult -from ._models import CreateLivenessWithVerifySessionContent -from ._models import CreateLivenessWithVerifySessionMultipartContent -from ._models import CreateLivenessWithVerifySessionResult -from ._models import CreatePersonResult -from ._models import ExposureProperties -from ._models import FaceAttributes -from ._models import FaceDetectionResult -from ._models import FaceError -from ._models import FaceErrorResponse -from ._models import FaceFindSimilarResult -from ._models import FaceGroupingResult -from ._models import FaceIdentificationCandidate -from ._models import FaceIdentificationResult -from ._models import FaceLandmarks -from ._models import FaceRectangle -from ._models import FaceTrainingResult -from ._models import FaceVerificationResult -from ._models import FacialHair -from ._models import HairColor -from ._models import HairProperties -from ._models import HeadPose -from ._models import LandmarkCoordinate -from ._models import LargeFaceList -from ._models import LargeFaceListFace -from ._models import LargePersonGroup -from ._models import LargePersonGroupPerson -from ._models import LargePersonGroupPersonFace -from ._models import LivenessOutputsTarget -from ._models import LivenessResponseBody -from ._models import LivenessSession -from ._models import LivenessSessionAuditEntry -from ._models import LivenessSessionItem -from ._models import LivenessWithVerifyImage -from ._models import LivenessWithVerifyOutputs -from ._models import LivenessWithVerifySession -from ._models import MaskProperties -from ._models import NoiseProperties -from ._models import OcclusionProperties +from typing import TYPE_CHECKING -from ._enums import AccessoryType -from ._enums import BlurLevel -from ._enums import ExposureLevel -from ._enums import FaceAttributeType -from ._enums import FaceDetectionModel -from ._enums import FaceImageType -from ._enums import FaceLivenessDecision -from ._enums import FaceOperationStatus -from ._enums import FaceRecognitionModel -from ._enums import FaceSessionStatus -from ._enums import FindSimilarMatchMode -from ._enums import GlassesType -from ._enums import HairColorType -from ._enums import LivenessModel -from ._enums import LivenessOperationMode -from ._enums import MaskType -from ._enums import NoiseLevel -from ._enums import QualityForRecognition -from ._enums import Versions +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import -from ._patch import FaceAttributeTypeDetection01 -from ._patch import FaceAttributeTypeDetection03 -from ._patch import FaceAttributeTypeRecognition03 -from ._patch import FaceAttributeTypeRecognition04 + +from ._models import ( # type: ignore + AccessoryItem, + AddFaceResult, + AuditLivenessResponseInfo, + AuditRequestInfo, + BlurProperties, + CreateLivenessSessionContent, + CreateLivenessSessionResult, + CreateLivenessWithVerifySessionContent, + CreateLivenessWithVerifySessionMultipartContent, + CreateLivenessWithVerifySessionResult, + CreatePersonResult, + ExposureProperties, + FaceAttributes, + FaceDetectionResult, + FaceError, + FaceErrorResponse, + FaceFindSimilarResult, + FaceGroupingResult, + FaceIdentificationCandidate, + FaceIdentificationResult, + FaceLandmarks, + FaceRectangle, + FaceTrainingResult, + FaceVerificationResult, + FacialHair, + HairColor, + HairProperties, + HeadPose, + LandmarkCoordinate, + LargeFaceList, + LargeFaceListFace, + LargePersonGroup, + LargePersonGroupPerson, + LargePersonGroupPersonFace, + LivenessOutputsTarget, + LivenessResponseBody, + LivenessSession, + LivenessSessionAuditEntry, + LivenessSessionItem, + LivenessWithVerifyImage, + LivenessWithVerifyOutputs, + LivenessWithVerifySession, + MaskProperties, + NoiseProperties, + OcclusionProperties, +) + +from ._enums import ( # type: ignore + AccessoryType, + BlurLevel, + ExposureLevel, + FaceAttributeType, + FaceDetectionModel, + FaceImageType, + FaceLivenessDecision, + FaceOperationStatus, + FaceRecognitionModel, + FaceSessionStatus, + FindSimilarMatchMode, + GlassesType, + HairColorType, + LivenessModel, + LivenessOperationMode, + MaskType, + NoiseLevel, + QualityForRecognition, + Versions, +) +from ._patch import __all__ as _patch_all +from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ - "FaceAttributeTypeDetection01", - "FaceAttributeTypeDetection03", - "FaceAttributeTypeRecognition03", - "FaceAttributeTypeRecognition04", "AccessoryItem", "AddFaceResult", "AuditLivenessResponseInfo", @@ -148,5 +152,5 @@ "QualityForRecognition", "Versions", ] - +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/face/azure-ai-vision-face/azure/ai/vision/face/models/_models.py b/sdk/face/azure-ai-vision-face/azure/ai/vision/face/models/_models.py index df4774e39456..af2daad15b51 100644 --- a/sdk/face/azure-ai-vision-face/azure/ai/vision/face/models/_models.py +++ b/sdk/face/azure-ai-vision-face/azure/ai/vision/face/models/_models.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=useless-super-delegation import datetime from typing import Any, List, Mapping, Optional, TYPE_CHECKING, Union, overload @@ -40,16 +41,16 @@ def __init__( *, type: Union[str, "_models.AccessoryType"], confidence: float, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -73,16 +74,16 @@ def __init__( self, *, persisted_face_id: str, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -115,16 +116,16 @@ def __init__( body: "_models.LivenessResponseBody", status_code: int, latency_in_milliseconds: int, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -164,16 +165,16 @@ def __init__( content_type: str, content_length: Optional[int] = None, user_agent: Optional[str] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -200,16 +201,16 @@ def __init__( *, blur_level: Union[str, "_models.BlurLevel"], value: float, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -282,16 +283,16 @@ def __init__( liveness_single_modal_model: Optional[Union[str, "_models.LivenessModel"]] = None, device_correlation_id: Optional[str] = None, auth_token_time_to_live_in_seconds: Optional[int] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -323,16 +324,16 @@ def __init__( *, session_id: str, auth_token: str, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -415,16 +416,16 @@ def __init__( auth_token_time_to_live_in_seconds: Optional[int] = None, return_verify_image_hash: Optional[bool] = None, verify_confidence_threshold: Optional[float] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -452,16 +453,16 @@ def __init__( *, parameters: "_models.CreateLivenessWithVerifySessionContent", verify_image: FileType, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -498,16 +499,16 @@ def __init__( session_id: str, auth_token: str, verify_image: Optional["_models.LivenessWithVerifyImage"] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -527,16 +528,16 @@ def __init__( self, *, person_id: str, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -565,20 +566,20 @@ def __init__( *, exposure_level: Union[str, "_models.ExposureLevel"], value: float, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class FaceAttributes(_model_base.Model): # pylint: disable=too-many-instance-attributes +class FaceAttributes(_model_base.Model): """Face attributes for the detected face. :ivar age: Age in years. @@ -661,16 +662,16 @@ def __init__( noise: Optional["_models.NoiseProperties"] = None, mask: Optional["_models.MaskProperties"] = None, quality_for_recognition: Optional[Union[str, "_models.QualityForRecognition"]] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -719,16 +720,16 @@ def __init__( recognition_model: Optional[Union[str, "_models.FaceRecognitionModel"]] = None, face_landmarks: Optional["_models.FaceLandmarks"] = None, face_attributes: Optional["_models.FaceAttributes"] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -754,16 +755,16 @@ def __init__( *, code: str, message: str, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -783,16 +784,16 @@ def __init__( self, *, error: "_models.FaceError", - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -828,16 +829,16 @@ def __init__( confidence: float, face_id: Optional[str] = None, persisted_face_id: Optional[str] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -865,16 +866,16 @@ def __init__( *, groups: List[List[str]], messy_group: List[str], - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -901,16 +902,16 @@ def __init__( *, person_id: str, confidence: float, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -939,20 +940,20 @@ def __init__( *, face_id: str, candidates: List["_models.FaceIdentificationCandidate"], - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class FaceLandmarks(_model_base.Model): # pylint: disable=too-many-instance-attributes +class FaceLandmarks(_model_base.Model): """A collection of 27-point face landmarks pointing to the important positions of face components. @@ -1098,16 +1099,16 @@ def __init__( # pylint: disable=too-many-locals upper_lip_bottom: "_models.LandmarkCoordinate", under_lip_top: "_models.LandmarkCoordinate", under_lip_bottom: "_models.LandmarkCoordinate", - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -1146,16 +1147,16 @@ def __init__( left: int, width: int, height: int, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -1208,16 +1209,16 @@ def __init__( last_action_date_time: datetime.datetime, last_successful_training_date_time: datetime.datetime, message: Optional[str] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -1250,16 +1251,16 @@ def __init__( *, is_identical: bool, confidence: float, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -1295,16 +1296,16 @@ def __init__( moustache: float, beard: float, sideburns: float, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -1331,16 +1332,16 @@ def __init__( *, color: Union[str, "_models.HairColorType"], confidence: float, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -1371,16 +1372,16 @@ def __init__( bald: float, invisible: bool, hair_color: List["_models.HairColor"], - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -1410,16 +1411,16 @@ def __init__( pitch: float, roll: float, yaw: float, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -1444,16 +1445,16 @@ def __init__( *, x: float, y: float, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -1494,16 +1495,16 @@ def __init__( name: str, user_data: Optional[str] = None, recognition_model: Optional[Union[str, "_models.FaceRecognitionModel"]] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -1529,16 +1530,16 @@ def __init__( self, *, user_data: Optional[str] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -1579,16 +1580,16 @@ def __init__( name: str, user_data: Optional[str] = None, recognition_model: Optional[Union[str, "_models.FaceRecognitionModel"]] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -1625,16 +1626,16 @@ def __init__( name: str, user_data: Optional[str] = None, persisted_face_ids: Optional[List[str]] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -1660,16 +1661,16 @@ def __init__( self, *, user_data: Optional[str] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -1710,16 +1711,16 @@ def __init__( file_name: str, time_offset_within_file: int, image_type: Union[str, "_models.FaceImageType"], - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -1758,16 +1759,16 @@ def __init__( target: Optional["_models.LivenessOutputsTarget"] = None, model_version_used: Optional[Union[str, "_models.LivenessModel"]] = None, verify_result: Optional["_models.LivenessWithVerifyOutputs"] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -1830,16 +1831,16 @@ def __init__( device_correlation_id: Optional[str] = None, auth_token_time_to_live_in_seconds: Optional[int] = None, result: Optional["_models.LivenessSessionAuditEntry"] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -1919,16 +1920,16 @@ def __init__( digest: str, session_image_id: Optional[str] = None, verify_image_hash: Optional[str] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -1979,16 +1980,16 @@ def __init__( session_start_date_time: Optional[datetime.datetime] = None, device_correlation_id: Optional[str] = None, auth_token_time_to_live_in_seconds: Optional[int] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -2016,16 +2017,16 @@ def __init__( *, face_rectangle: "_models.FaceRectangle", quality_for_recognition: Union[str, "_models.QualityForRecognition"], - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -2056,16 +2057,16 @@ def __init__( verify_image: "_models.LivenessWithVerifyImage", match_confidence: float, is_identical: bool, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -2128,16 +2129,16 @@ def __init__( device_correlation_id: Optional[str] = None, auth_token_time_to_live_in_seconds: Optional[int] = None, result: Optional["_models.LivenessSessionAuditEntry"] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -2165,16 +2166,16 @@ def __init__( *, nose_and_mouth_covered: bool, type: Union[str, "_models.MaskType"], - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -2205,16 +2206,16 @@ def __init__( *, noise_level: Union[str, "_models.NoiseLevel"], value: float, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -2244,14 +2245,14 @@ def __init__( forehead_occluded: bool, eye_occluded: bool, mouth_occluded: bool, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) diff --git a/sdk/face/azure-ai-vision-face/azure/ai/vision/face/models/_patch.py b/sdk/face/azure-ai-vision-face/azure/ai/vision/face/models/_patch.py index 620f4d62e728..f7dd32510333 100644 --- a/sdk/face/azure-ai-vision-face/azure/ai/vision/face/models/_patch.py +++ b/sdk/face/azure-ai-vision-face/azure/ai/vision/face/models/_patch.py @@ -1,5 +1,3 @@ -# mypy: disable_error_code=misc -# pyright: reportGeneralTypeIssues=false # ------------------------------------ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. @@ -8,52 +6,9 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from enum import Enum from typing import List -from azure.core import CaseInsensitiveEnumMeta - -from ._enums import FaceAttributeType - - -class FaceAttributeTypeDetection01(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Available attribute options for detection_01 model.""" - - ACCESSORIES = FaceAttributeType.ACCESSORIES.value - BLUR = FaceAttributeType.BLUR.value - EXPOSURE = FaceAttributeType.EXPOSURE.value - GLASSES = FaceAttributeType.GLASSES.value - HEAD_POSE = FaceAttributeType.HEAD_POSE.value - NOISE = FaceAttributeType.NOISE.value - OCCLUSION = FaceAttributeType.OCCLUSION.value - - -class FaceAttributeTypeDetection03(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Available attribute options for detection_03 model.""" - - BLUR = FaceAttributeType.BLUR.value - HEAD_POSE = FaceAttributeType.HEAD_POSE.value - MASK = FaceAttributeType.MASK.value - - -class FaceAttributeTypeRecognition03(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Available attribute options for recognition_03 model.""" - - QUALITY_FOR_RECOGNITION = FaceAttributeType.QUALITY_FOR_RECOGNITION.value - - -class FaceAttributeTypeRecognition04(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Available attribute options for recognition_04 model.""" - - QUALITY_FOR_RECOGNITION = FaceAttributeType.QUALITY_FOR_RECOGNITION.value - - -__all__: List[str] = [ - "FaceAttributeTypeDetection01", - "FaceAttributeTypeDetection03", - "FaceAttributeTypeRecognition03", - "FaceAttributeTypeRecognition04", -] # Add all objects you want publicly available to users at this package level +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/face/azure-ai-vision-face/azure/ai/vision/face/operations/__init__.py b/sdk/face/azure-ai-vision-face/azure/ai/vision/face/operations/__init__.py index d69ac05180a1..b51ef2b0b13a 100644 --- a/sdk/face/azure-ai-vision-face/azure/ai/vision/face/operations/__init__.py +++ b/sdk/face/azure-ai-vision-face/azure/ai/vision/face/operations/__init__.py @@ -5,14 +5,20 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._operations import LargeFaceListOperations -from ._operations import LargePersonGroupOperations -from ._operations import FaceClientOperationsMixin -from ._operations import FaceSessionClientOperationsMixin +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import LargeFaceListOperations # type: ignore +from ._operations import LargePersonGroupOperations # type: ignore +from ._operations import FaceClientOperationsMixin # type: ignore +from ._operations import FaceSessionClientOperationsMixin # type: ignore from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ @@ -21,5 +27,5 @@ "FaceClientOperationsMixin", "FaceSessionClientOperationsMixin", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/face/azure-ai-vision-face/tsp-location.yaml b/sdk/face/azure-ai-vision-face/tsp-location.yaml index ceff84974c6e..42916d2c41e8 100644 --- a/sdk/face/azure-ai-vision-face/tsp-location.yaml +++ b/sdk/face/azure-ai-vision-face/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/ai/Face -commit: 4037b28c1014648f4cfa6f8c965e45f2476652e2 +commit: 0e268a0c63dbabfc740047673fe160411090415a repo: Azure/azure-rest-api-specs -additionalDirectories: +additionalDirectories: