diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-face/azure/cognitiveservices/vision/face/models/__init__.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-face/azure/cognitiveservices/vision/face/models/__init__.py index 79f68c61ae3e..0bdbfd9bd9e4 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-face/azure/cognitiveservices/vision/face/models/__init__.py +++ b/sdk/cognitiveservices/azure-cognitiveservices-vision-face/azure/cognitiveservices/vision/face/models/__init__.py @@ -37,6 +37,7 @@ from ._models_py3 import LargeFaceList from ._models_py3 import LargePersonGroup from ._models_py3 import Makeup + from ._models_py3 import Mask from ._models_py3 import MetaDataContract from ._models_py3 import NameAndUserDataContract from ._models_py3 import Noise @@ -82,6 +83,7 @@ from ._models import LargeFaceList from ._models import LargePersonGroup from ._models import Makeup + from ._models import Mask from ._models import MetaDataContract from ._models import NameAndUserDataContract from ._models import Noise @@ -109,6 +111,7 @@ Gender, GlassesType, HairColorType, + MaskType, NoiseLevel, OperationStatusType, RecognitionModel, @@ -145,6 +148,7 @@ 'LargeFaceList', 'LargePersonGroup', 'Makeup', + 'Mask', 'MetaDataContract', 'NameAndUserDataContract', 'Noise', @@ -170,6 +174,7 @@ 'BlurLevel', 'ExposureLevel', 'NoiseLevel', + 'MaskType', 'FindSimilarMatchMode', 'TrainingStatusType', 'SnapshotApplyMode', diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-face/azure/cognitiveservices/vision/face/models/_face_client_enums.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-face/azure/cognitiveservices/vision/face/models/_face_client_enums.py index b3fed2fd6d7f..6c78c7d43830 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-face/azure/cognitiveservices/vision/face/models/_face_client_enums.py +++ b/sdk/cognitiveservices/azure-cognitiveservices-vision-face/azure/cognitiveservices/vision/face/models/_face_client_enums.py @@ -16,6 +16,8 @@ class RecognitionModel(str, Enum): recognition_01 = "recognition_01" recognition_02 = "recognition_02" + recognition_03 = "recognition_03" + recognition_04 = "recognition_04" class Gender(str, Enum): @@ -72,6 +74,14 @@ class NoiseLevel(str, Enum): high = "High" +class MaskType(str, Enum): + + no_mask = "noMask" + face_mask = "faceMask" + other_mask_or_occlusion = "otherMaskOrOcclusion" + uncertain = "uncertain" + + class FindSimilarMatchMode(str, Enum): match_person = "matchPerson" @@ -123,9 +133,11 @@ class FaceAttributeType(str, Enum): blur = "blur" exposure = "exposure" noise = "noise" + mask = "mask" class DetectionModel(str, Enum): detection_01 = "detection_01" detection_02 = "detection_02" + detection_03 = "detection_03" diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-face/azure/cognitiveservices/vision/face/models/_models.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-face/azure/cognitiveservices/vision/face/models/_models.py index bc0b3049df8e..736c22105592 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-face/azure/cognitiveservices/vision/face/models/_models.py +++ b/sdk/cognitiveservices/azure-cognitiveservices-vision-face/azure/cognitiveservices/vision/face/models/_models.py @@ -153,7 +153,8 @@ class DetectedFace(Model): :param face_id: :type face_id: str :param recognition_model: Possible values include: 'recognition_01', - 'recognition_02'. Default value: "recognition_01" . + 'recognition_02', 'recognition_03', 'recognition_04'. Default value: + "recognition_01" . :type recognition_model: str or ~azure.cognitiveservices.vision.face.models.RecognitionModel :param face_rectangle: Required. @@ -300,7 +301,8 @@ class FaceAttributes(Model): :type emotion: ~azure.cognitiveservices.vision.face.models.Emotion :param hair: Properties describing hair attributes. :type hair: ~azure.cognitiveservices.vision.face.models.Hair - :param makeup: Properties describing present makeups on a given face. + :param makeup: Properties describing the presence of makeup on a given + face. :type makeup: ~azure.cognitiveservices.vision.face.models.Makeup :param occlusion: Properties describing occlusions on a given face. :type occlusion: ~azure.cognitiveservices.vision.face.models.Occlusion @@ -313,6 +315,8 @@ class FaceAttributes(Model): :type exposure: ~azure.cognitiveservices.vision.face.models.Exposure :param noise: Properties describing noise level of the image. :type noise: ~azure.cognitiveservices.vision.face.models.Noise + :param mask: Properties describing the presence of a mask on a given face. + :type mask: ~azure.cognitiveservices.vision.face.models.Mask """ _attribute_map = { @@ -330,6 +334,7 @@ class FaceAttributes(Model): 'blur': {'key': 'blur', 'type': 'Blur'}, 'exposure': {'key': 'exposure', 'type': 'Exposure'}, 'noise': {'key': 'noise', 'type': 'Noise'}, + 'mask': {'key': 'mask', 'type': 'Mask'}, } def __init__(self, **kwargs): @@ -348,6 +353,7 @@ def __init__(self, **kwargs): self.blur = kwargs.get('blur', None) self.exposure = kwargs.get('exposure', None) self.noise = kwargs.get('noise', None) + self.mask = kwargs.get('mask', None) class FaceLandmarks(Model): @@ -527,7 +533,8 @@ class MetaDataContract(NameAndUserDataContract): :param user_data: User specified data. Length should not exceed 16KB. :type user_data: str :param recognition_model: Possible values include: 'recognition_01', - 'recognition_02'. Default value: "recognition_01" . + 'recognition_02', 'recognition_03', 'recognition_04'. Default value: + "recognition_01" . :type recognition_model: str or ~azure.cognitiveservices.vision.face.models.RecognitionModel """ @@ -558,7 +565,8 @@ class FaceList(MetaDataContract): :param user_data: User specified data. Length should not exceed 16KB. :type user_data: str :param recognition_model: Possible values include: 'recognition_01', - 'recognition_02'. Default value: "recognition_01" . + 'recognition_02', 'recognition_03', 'recognition_04'. Default value: + "recognition_01" . :type recognition_model: str or ~azure.cognitiveservices.vision.face.models.RecognitionModel :param face_list_id: Required. FaceListId of the target face list. @@ -658,7 +666,8 @@ class FindSimilarRequest(Model): :param face_id: Required. FaceId of the query face. User needs to call Face - Detect first to get a valid faceId. Note that this faceId is not - persisted and will expire 24 hours after the detection call + persisted and will expire at the time specified by faceIdTimeToLive after + the detection call :type face_id: str :param face_list_id: An existing user-specified unique candidate face list, created in Face List - Create a Face List. Face list contains a set @@ -673,9 +682,10 @@ class FindSimilarRequest(Model): provided at the same time. :type large_face_list_id: str :param face_ids: An array of candidate faceIds. All of them are created by - Face - Detect and the faceIds will expire 24 hours after the detection - call. The number of faceIds is limited to 1000. Parameter faceListId, - largeFaceListId and faceIds should not be provided at the same time. + Face - Detect and the faceIds will expire at the time specified by + faceIdTimeToLive after the detection call. The number of faceIds is + limited to 1000. Parameter faceListId, largeFaceListId and faceIds should + not be provided at the same time. :type face_ids: list[str] :param max_num_of_candidates_returned: The number of top similar faces returned. The valid range is [1, 1000]. Default value: 20 . @@ -983,7 +993,8 @@ class LargeFaceList(MetaDataContract): :param user_data: User specified data. Length should not exceed 16KB. :type user_data: str :param recognition_model: Possible values include: 'recognition_01', - 'recognition_02'. Default value: "recognition_01" . + 'recognition_02', 'recognition_03', 'recognition_04'. Default value: + "recognition_01" . :type recognition_model: str or ~azure.cognitiveservices.vision.face.models.RecognitionModel :param large_face_list_id: Required. LargeFaceListId of the target large @@ -1019,7 +1030,8 @@ class LargePersonGroup(MetaDataContract): :param user_data: User specified data. Length should not exceed 16KB. :type user_data: str :param recognition_model: Possible values include: 'recognition_01', - 'recognition_02'. Default value: "recognition_01" . + 'recognition_02', 'recognition_03', 'recognition_04'. Default value: + "recognition_01" . :type recognition_model: str or ~azure.cognitiveservices.vision.face.models.RecognitionModel :param large_person_group_id: Required. LargePersonGroupId of the target @@ -1046,7 +1058,7 @@ def __init__(self, **kwargs): class Makeup(Model): - """Properties describing present makeups on a given face. + """Properties describing the presence of makeup on a given face. :param eye_makeup: A boolean value describing whether eye makeup is present on a face. @@ -1067,6 +1079,28 @@ def __init__(self, **kwargs): self.lip_makeup = kwargs.get('lip_makeup', None) +class Mask(Model): + """Properties describing the presence of a mask on a given face. + + :param type: Mask type if any of the face. Possible values include: + 'noMask', 'faceMask', 'otherMaskOrOcclusion', 'uncertain' + :type type: str or ~azure.cognitiveservices.vision.face.models.MaskType + :param nose_and_mouth_covered: A boolean value indicating whether nose and + mouth are covered. + :type nose_and_mouth_covered: bool + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'MaskType'}, + 'nose_and_mouth_covered': {'key': 'noseAndMouthCovered', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(Mask, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.nose_and_mouth_covered = kwargs.get('nose_and_mouth_covered', None) + + class Noise(Model): """Properties describing noise level of the image. @@ -1186,8 +1220,8 @@ class PersistedFace(Model): :param persisted_face_id: Required. The persistedFaceId of the target face, which is persisted and will not expire. Different from faceId - created by Face - Detect and will expire in 24 hours after the detection - call. + created by Face - Detect and will expire in at the time specified by + faceIdTimeToLive after the detection call. :type persisted_face_id: str :param user_data: User-provided data attached to the face. The size limit is 1KB. @@ -1256,7 +1290,8 @@ class PersonGroup(MetaDataContract): :param user_data: User specified data. Length should not exceed 16KB. :type user_data: str :param recognition_model: Possible values include: 'recognition_01', - 'recognition_02'. Default value: "recognition_01" . + 'recognition_02', 'recognition_03', 'recognition_04'. Default value: + "recognition_01" . :type recognition_model: str or ~azure.cognitiveservices.vision.face.models.RecognitionModel :param person_group_id: Required. PersonGroupId of the target person @@ -1288,7 +1323,8 @@ class SimilarFace(Model): All required parameters must be populated in order to send to Azure. :param face_id: FaceId of candidate face when find by faceIds. faceId is - created by Face - Detect and will expire 24 hours after the detection call + created by Face - Detect and will expire at the time specified by + faceIdTimeToLive after the detection call :type face_id: str :param persisted_face_id: PersistedFaceId of candidate face when find by faceListId. persistedFaceId in face list is persisted and will not expire. diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-face/azure/cognitiveservices/vision/face/models/_models_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-face/azure/cognitiveservices/vision/face/models/_models_py3.py index 64ac24c59ed7..df42f35b07bf 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-face/azure/cognitiveservices/vision/face/models/_models_py3.py +++ b/sdk/cognitiveservices/azure-cognitiveservices-vision-face/azure/cognitiveservices/vision/face/models/_models_py3.py @@ -153,7 +153,8 @@ class DetectedFace(Model): :param face_id: :type face_id: str :param recognition_model: Possible values include: 'recognition_01', - 'recognition_02'. Default value: "recognition_01" . + 'recognition_02', 'recognition_03', 'recognition_04'. Default value: + "recognition_01" . :type recognition_model: str or ~azure.cognitiveservices.vision.face.models.RecognitionModel :param face_rectangle: Required. @@ -300,7 +301,8 @@ class FaceAttributes(Model): :type emotion: ~azure.cognitiveservices.vision.face.models.Emotion :param hair: Properties describing hair attributes. :type hair: ~azure.cognitiveservices.vision.face.models.Hair - :param makeup: Properties describing present makeups on a given face. + :param makeup: Properties describing the presence of makeup on a given + face. :type makeup: ~azure.cognitiveservices.vision.face.models.Makeup :param occlusion: Properties describing occlusions on a given face. :type occlusion: ~azure.cognitiveservices.vision.face.models.Occlusion @@ -313,6 +315,8 @@ class FaceAttributes(Model): :type exposure: ~azure.cognitiveservices.vision.face.models.Exposure :param noise: Properties describing noise level of the image. :type noise: ~azure.cognitiveservices.vision.face.models.Noise + :param mask: Properties describing the presence of a mask on a given face. + :type mask: ~azure.cognitiveservices.vision.face.models.Mask """ _attribute_map = { @@ -330,9 +334,10 @@ class FaceAttributes(Model): 'blur': {'key': 'blur', 'type': 'Blur'}, 'exposure': {'key': 'exposure', 'type': 'Exposure'}, 'noise': {'key': 'noise', 'type': 'Noise'}, + 'mask': {'key': 'mask', 'type': 'Mask'}, } - def __init__(self, *, age: float=None, gender=None, smile: float=None, facial_hair=None, glasses=None, head_pose=None, emotion=None, hair=None, makeup=None, occlusion=None, accessories=None, blur=None, exposure=None, noise=None, **kwargs) -> None: + def __init__(self, *, age: float=None, gender=None, smile: float=None, facial_hair=None, glasses=None, head_pose=None, emotion=None, hair=None, makeup=None, occlusion=None, accessories=None, blur=None, exposure=None, noise=None, mask=None, **kwargs) -> None: super(FaceAttributes, self).__init__(**kwargs) self.age = age self.gender = gender @@ -348,6 +353,7 @@ def __init__(self, *, age: float=None, gender=None, smile: float=None, facial_ha self.blur = blur self.exposure = exposure self.noise = noise + self.mask = mask class FaceLandmarks(Model): @@ -527,7 +533,8 @@ class MetaDataContract(NameAndUserDataContract): :param user_data: User specified data. Length should not exceed 16KB. :type user_data: str :param recognition_model: Possible values include: 'recognition_01', - 'recognition_02'. Default value: "recognition_01" . + 'recognition_02', 'recognition_03', 'recognition_04'. Default value: + "recognition_01" . :type recognition_model: str or ~azure.cognitiveservices.vision.face.models.RecognitionModel """ @@ -558,7 +565,8 @@ class FaceList(MetaDataContract): :param user_data: User specified data. Length should not exceed 16KB. :type user_data: str :param recognition_model: Possible values include: 'recognition_01', - 'recognition_02'. Default value: "recognition_01" . + 'recognition_02', 'recognition_03', 'recognition_04'. Default value: + "recognition_01" . :type recognition_model: str or ~azure.cognitiveservices.vision.face.models.RecognitionModel :param face_list_id: Required. FaceListId of the target face list. @@ -658,7 +666,8 @@ class FindSimilarRequest(Model): :param face_id: Required. FaceId of the query face. User needs to call Face - Detect first to get a valid faceId. Note that this faceId is not - persisted and will expire 24 hours after the detection call + persisted and will expire at the time specified by faceIdTimeToLive after + the detection call :type face_id: str :param face_list_id: An existing user-specified unique candidate face list, created in Face List - Create a Face List. Face list contains a set @@ -673,9 +682,10 @@ class FindSimilarRequest(Model): provided at the same time. :type large_face_list_id: str :param face_ids: An array of candidate faceIds. All of them are created by - Face - Detect and the faceIds will expire 24 hours after the detection - call. The number of faceIds is limited to 1000. Parameter faceListId, - largeFaceListId and faceIds should not be provided at the same time. + Face - Detect and the faceIds will expire at the time specified by + faceIdTimeToLive after the detection call. The number of faceIds is + limited to 1000. Parameter faceListId, largeFaceListId and faceIds should + not be provided at the same time. :type face_ids: list[str] :param max_num_of_candidates_returned: The number of top similar faces returned. The valid range is [1, 1000]. Default value: 20 . @@ -983,7 +993,8 @@ class LargeFaceList(MetaDataContract): :param user_data: User specified data. Length should not exceed 16KB. :type user_data: str :param recognition_model: Possible values include: 'recognition_01', - 'recognition_02'. Default value: "recognition_01" . + 'recognition_02', 'recognition_03', 'recognition_04'. Default value: + "recognition_01" . :type recognition_model: str or ~azure.cognitiveservices.vision.face.models.RecognitionModel :param large_face_list_id: Required. LargeFaceListId of the target large @@ -1019,7 +1030,8 @@ class LargePersonGroup(MetaDataContract): :param user_data: User specified data. Length should not exceed 16KB. :type user_data: str :param recognition_model: Possible values include: 'recognition_01', - 'recognition_02'. Default value: "recognition_01" . + 'recognition_02', 'recognition_03', 'recognition_04'. Default value: + "recognition_01" . :type recognition_model: str or ~azure.cognitiveservices.vision.face.models.RecognitionModel :param large_person_group_id: Required. LargePersonGroupId of the target @@ -1046,7 +1058,7 @@ def __init__(self, *, large_person_group_id: str, name: str=None, user_data: str class Makeup(Model): - """Properties describing present makeups on a given face. + """Properties describing the presence of makeup on a given face. :param eye_makeup: A boolean value describing whether eye makeup is present on a face. @@ -1067,6 +1079,28 @@ def __init__(self, *, eye_makeup: bool=None, lip_makeup: bool=None, **kwargs) -> self.lip_makeup = lip_makeup +class Mask(Model): + """Properties describing the presence of a mask on a given face. + + :param type: Mask type if any of the face. Possible values include: + 'noMask', 'faceMask', 'otherMaskOrOcclusion', 'uncertain' + :type type: str or ~azure.cognitiveservices.vision.face.models.MaskType + :param nose_and_mouth_covered: A boolean value indicating whether nose and + mouth are covered. + :type nose_and_mouth_covered: bool + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'MaskType'}, + 'nose_and_mouth_covered': {'key': 'noseAndMouthCovered', 'type': 'bool'}, + } + + def __init__(self, *, type=None, nose_and_mouth_covered: bool=None, **kwargs) -> None: + super(Mask, self).__init__(**kwargs) + self.type = type + self.nose_and_mouth_covered = nose_and_mouth_covered + + class Noise(Model): """Properties describing noise level of the image. @@ -1186,8 +1220,8 @@ class PersistedFace(Model): :param persisted_face_id: Required. The persistedFaceId of the target face, which is persisted and will not expire. Different from faceId - created by Face - Detect and will expire in 24 hours after the detection - call. + created by Face - Detect and will expire in at the time specified by + faceIdTimeToLive after the detection call. :type persisted_face_id: str :param user_data: User-provided data attached to the face. The size limit is 1KB. @@ -1256,7 +1290,8 @@ class PersonGroup(MetaDataContract): :param user_data: User specified data. Length should not exceed 16KB. :type user_data: str :param recognition_model: Possible values include: 'recognition_01', - 'recognition_02'. Default value: "recognition_01" . + 'recognition_02', 'recognition_03', 'recognition_04'. Default value: + "recognition_01" . :type recognition_model: str or ~azure.cognitiveservices.vision.face.models.RecognitionModel :param person_group_id: Required. PersonGroupId of the target person @@ -1288,7 +1323,8 @@ class SimilarFace(Model): All required parameters must be populated in order to send to Azure. :param face_id: FaceId of candidate face when find by faceIds. faceId is - created by Face - Detect and will expire 24 hours after the detection call + created by Face - Detect and will expire at the time specified by + faceIdTimeToLive after the detection call :type face_id: str :param persisted_face_id: PersistedFaceId of candidate face when find by faceListId. persistedFaceId in face list is persisted and will not expire. diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-face/azure/cognitiveservices/vision/face/operations/_face_list_operations.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-face/azure/cognitiveservices/vision/face/operations/_face_list_operations.py index 20457119ee27..0d6e7db263ed 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-face/azure/cognitiveservices/vision/face/operations/_face_list_operations.py +++ b/sdk/cognitiveservices/azure-cognitiveservices-vision-face/azure/cognitiveservices/vision/face/operations/_face_list_operations.py @@ -42,23 +42,23 @@ def create( in one subscription.
Face list is a list of faces, up to 1,000 faces, and used by [Face - Find - Similar](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395237). + Similar](https://docs.microsoft.com/rest/api/faceapi/face/findsimilar).
After creation, user should use [FaceList - Add - Face](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395250) + Face](https://docs.microsoft.com/rest/api/faceapi/facelist/addfacefromurl) to import the faces. No image will be stored. Only the extracted face features are stored on server until [FaceList - - Delete](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039524f) - is called. + Delete](https://docs.microsoft.com/rest/api/faceapi/facelist/delete) is + called.
Find Similar is used for scenario like finding celebrity-like faces, similar face filtering, or as a light way face identification. But if the actual use is to identify person, please use - [PersonGroup](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395244) + [PersonGroup](https://docs.microsoft.com/rest/api/faceapi/persongroup) / - [LargePersonGroup](/docs/services/563879b61984550e40cbbe8d/operations/599acdee6ac60f11b48b5a9d) + [LargePersonGroup](https://docs.microsoft.com/rest/api/faceapi/largepersongroup) and [Face - - Identify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395239). + Identify](https://docs.microsoft.com/rest/api/faceapi/face/identify).
Please consider - [LargeFaceList](/docs/services/563879b61984550e40cbbe8d/operations/5a157b68d2de3616c086f2cc) + [LargeFaceList](https://docs.microsoft.com/rest/api/faceapi/largefacelist) when the face number is large. It can support up to 1,000,000 faces.
'recognitionModel' should be specified to associate with this face list. The default value for 'recognitionModel' is @@ -68,13 +68,8 @@ def create( associated with the collection. Existing face features in a face list can't be updated to features extracted by another version of recognition model. - * 'recognition_01': The default recognition model for [FaceList- - Create](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039524b). - All those face lists created before 2019 March are bonded with this - recognition model. - * 'recognition_02': Recognition model released in 2019 March. - 'recognition_02' is recommended since its overall accuracy is improved - compared with 'recognition_01'. + Please Refer to [Specify a face recognition + model](https://docs.microsoft.com/azure/cognitive-services/face/face-api-how-to-topics/specify-recognition-model). :param face_list_id: Id referencing a particular face list. :type face_list_id: str @@ -83,7 +78,7 @@ def create( :param user_data: User specified data. Length should not exceed 16KB. :type user_data: str :param recognition_model: Possible values include: 'recognition_01', - 'recognition_02' + 'recognition_02', 'recognition_03', 'recognition_04' :type recognition_model: str or ~azure.cognitiveservices.vision.face.models.RecognitionModel :param dict custom_headers: headers that will be added to the request @@ -292,7 +287,7 @@ def list( """List face lists’ faceListId, name, userData and recognitionModel.
To get face information inside faceList use [FaceList - - Get](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039524c) + Get](https://docs.microsoft.com/rest/api/faceapi/facelist/get) . :param return_recognition_model: A value indicating whether the @@ -404,13 +399,13 @@ def add_face_from_url( persistedFaceId representing the added face. No image will be stored. Only the extracted face feature will be stored on server until [FaceList - Delete - Face](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395251) + Face](https://docs.microsoft.com/rest/api/faceapi/facelist/deleteface) or [FaceList - - Delete](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039524f) - is called. + Delete](https://docs.microsoft.com/rest/api/faceapi/facelist/delete) is + called.
Note persistedFaceId is different from faceId generated by [Face - - Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236). + Detect](https://docs.microsoft.com/rest/api/faceapi/face/detectwithurl). * Higher face image quality means better detection and recognition precision. Please consider high-quality faces: frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. @@ -419,7 +414,7 @@ def add_face_from_url( * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the provided "targetFace" rectangle is not returned from [Face - - Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236), + Detect](https://docs.microsoft.com/rest/api/faceapi/face/detectwithurl), there’s no guarantee to detect and add the face successfully. * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause failures. @@ -430,16 +425,7 @@ def add_face_from_url( 1920x1080 pixels will need a proportionally larger minimum face size. * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer to [How to specify a detection - model](https://docs.microsoft.com/en-us/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model) - | Model | Recommended use-case(s) | - | ---------- | -------- | - | 'detection_01': | The default detection model for [FaceList - Add - Face](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395250). - Recommend for near frontal face detection. For scenarios with - exceptionally large angle (head-pose) faces, occluded faces or wrong - image orientation, the faces in such cases may not be detected. | - | 'detection_02': | Detection model released in 2019 May with improved - accuracy especially on small, side and blurry faces. |. + model](https://docs.microsoft.com/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model). :param face_list_id: Id referencing a particular face list. :type face_list_id: str @@ -459,7 +445,8 @@ def add_face_from_url( can be provided when performing Face - Detect or (Large)FaceList - Add Face or (Large)PersonGroup - Add Face. The default value is 'detection_01', if another model is needed, please explicitly specify - it. Possible values include: 'detection_01', 'detection_02' + it. Possible values include: 'detection_01', 'detection_02', + 'detection_03' :type detection_model: str or ~azure.cognitiveservices.vision.face.models.DetectionModel :param dict custom_headers: headers that will be added to the request @@ -528,13 +515,13 @@ def add_face_from_stream( persistedFaceId representing the added face. No image will be stored. Only the extracted face feature will be stored on server until [FaceList - Delete - Face](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395251) + Face](https://docs.microsoft.com/rest/api/faceapi/facelist/deleteface) or [FaceList - - Delete](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039524f) - is called. + Delete](https://docs.microsoft.com/rest/api/faceapi/facelist/delete) is + called.
Note persistedFaceId is different from faceId generated by [Face - - Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236). + Detect](https://docs.microsoft.com/rest/api/faceapi/face/detectwithurl). * Higher face image quality means better detection and recognition precision. Please consider high-quality faces: frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. @@ -543,7 +530,7 @@ def add_face_from_stream( * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the provided "targetFace" rectangle is not returned from [Face - - Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236), + Detect](https://docs.microsoft.com/rest/api/faceapi/face/detectwithurl), there’s no guarantee to detect and add the face successfully. * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause failures. @@ -554,16 +541,7 @@ def add_face_from_stream( 1920x1080 pixels will need a proportionally larger minimum face size. * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer to [How to specify a detection - model](https://docs.microsoft.com/en-us/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model) - | Model | Recommended use-case(s) | - | ---------- | -------- | - | 'detection_01': | The default detection model for [FaceList - Add - Face](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395250). - Recommend for near frontal face detection. For scenarios with - exceptionally large angle (head-pose) faces, occluded faces or wrong - image orientation, the faces in such cases may not be detected. | - | 'detection_02': | Detection model released in 2019 May with improved - accuracy especially on small, side and blurry faces. |. + model](https://docs.microsoft.com/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model). :param face_list_id: Id referencing a particular face list. :type face_list_id: str @@ -583,7 +561,8 @@ def add_face_from_stream( can be provided when performing Face - Detect or (Large)FaceList - Add Face or (Large)PersonGroup - Add Face. The default value is 'detection_01', if another model is needed, please explicitly specify - it. Possible values include: 'detection_01', 'detection_02' + it. Possible values include: 'detection_01', 'detection_02', + 'detection_03' :type detection_model: str or ~azure.cognitiveservices.vision.face.models.DetectionModel :param dict custom_headers: headers that will be added to the request diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-face/azure/cognitiveservices/vision/face/operations/_face_operations.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-face/azure/cognitiveservices/vision/face/operations/_face_operations.py index d2da536c3e62..41bf8d917e00 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-face/azure/cognitiveservices/vision/face/operations/_face_operations.py +++ b/sdk/cognitiveservices/azure-cognitiveservices-vision-face/azure/cognitiveservices/vision/face/operations/_face_operations.py @@ -39,14 +39,16 @@ def find_similar( self, face_id, face_list_id=None, large_face_list_id=None, face_ids=None, max_num_of_candidates_returned=20, mode="matchPerson", custom_headers=None, raw=False, **operation_config): """Given query face's faceId, to search the similar-looking faces from a faceId array, a face list or a large face list. faceId array contains - the faces created by [Face - - Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236), - which will expire 24 hours after creation. A "faceListId" is created by - [FaceList - - Create](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039524b) + the faces created by [Face - Detect With + Url](https://docs.microsoft.com/rest/api/faceapi/face/detectwithurl) or + [Face - Detect With + Stream](https://docs.microsoft.com/rest/api/faceapi/face/detectwithstream), + which will expire at the time specified by faceIdTimeToLive after + creation. A "faceListId" is created by [FaceList - + Create](https://docs.microsoft.com/rest/api/faceapi/facelist/create) containing persistedFaceIds that will not expire. And a "largeFaceListId" is created by [LargeFaceList - - Create](/docs/services/563879b61984550e40cbbe8d/operations/5a157b68d2de3616c086f2cc) + Create](https://docs.microsoft.com/rest/api/faceapi/largefacelist/create) containing persistedFaceIds that will also not expire. Depending on the input the returned similar faces list contains faceIds or persistedFaceIds ranked by similarity. @@ -65,7 +67,8 @@ def find_similar( :param face_id: FaceId of the query face. User needs to call Face - Detect first to get a valid faceId. Note that this faceId is not - persisted and will expire 24 hours after the detection call + persisted and will expire at the time specified by faceIdTimeToLive + after the detection call :type face_id: str :param face_list_id: An existing user-specified unique candidate face list, created in Face List - Create a Face List. Face list contains a @@ -80,10 +83,10 @@ def find_similar( be provided at the same time. :type large_face_list_id: str :param face_ids: An array of candidate faceIds. All of them are - created by Face - Detect and the faceIds will expire 24 hours after - the detection call. The number of faceIds is limited to 1000. - Parameter faceListId, largeFaceListId and faceIds should not be - provided at the same time. + created by Face - Detect and the faceIds will expire at the time + specified by faceIdTimeToLive after the detection call. The number of + faceIds is limited to 1000. Parameter faceListId, largeFaceListId and + faceIds should not be provided at the same time. :type face_ids: list[str] :param max_num_of_candidates_returned: The number of top similar faces returned. The valid range is [1, 1000]. @@ -156,7 +159,7 @@ def group( not appear in the result if all faces found their counterparts. * Group API needs at least 2 candidate faces and 1000 at most. We suggest to try [Face - - Verify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039523a) + Verify](https://docs.microsoft.com/rest/api/faceapi/face/verifyfacetoface) when you only have 2 candidate faces. * The 'recognitionModel' associated with the query faces' faceIds should be the same. @@ -227,9 +230,9 @@ def identify( ranked by similarity confidence. The person group/large person group should be trained to make it ready for identification. See more in [PersonGroup - - Train](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395249) + Train](https://docs.microsoft.com/rest/api/faceapi/persongroup/train) and [LargePersonGroup - - Train](/docs/services/563879b61984550e40cbbe8d/operations/599ae2d16ac60f11b48b5aa4). + Train](https://docs.microsoft.com/rest/api/faceapi/largepersongroup/train).
Remarks:
* The algorithm allows more than one face to be identified @@ -243,7 +246,7 @@ def identify( maxNumOfCandidatesReturned and confidenceThreshold. If no person is identified, the returned candidates will be an empty array. * Try [Face - Find - Similar](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395237) + Similar](https://docs.microsoft.com/rest/api/faceapi/face/findsimilar) when you need to find similar faces from a face list/large face list instead of a person group/large person group. * The 'recognitionModel' associated with the query faces' faceIds @@ -395,34 +398,34 @@ def verify_face_to_face( verify_face_to_face.metadata = {'url': '/verify'} def detect_with_url( - self, url, return_face_id=True, return_face_landmarks=False, return_face_attributes=None, recognition_model="recognition_01", return_recognition_model=False, detection_model="detection_01", custom_headers=None, raw=False, **operation_config): + self, url, return_face_id=True, return_face_landmarks=False, return_face_attributes=None, recognition_model="recognition_01", return_recognition_model=False, detection_model="detection_01", face_id_time_to_live=86400, custom_headers=None, raw=False, **operation_config): """Detect human faces in an image, return face rectangles, and optionally with faceIds, landmarks, and attributes.
* No image will be stored. Only the extracted face feature will be stored on server. The faceId is an identifier of the face feature and will be used in [Face - - Identify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395239), + Identify](https://docs.microsoft.com/rest/api/faceapi/face/identify), [Face - - Verify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039523a), + Verify](https://docs.microsoft.com/rest/api/faceapi/face/verifyfacetoface), and [Face - Find - Similar](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395237). - The stored face feature(s) will expire and be deleted 24 hours after - the original detection call. + Similar](https://docs.microsoft.com/rest/api/faceapi/face/findsimilar). + The stored face feature(s) will expire and be deleted at the time + specified by faceIdTimeToLive after the original detection call. * Optional parameters include faceId, landmarks, and attributes. Attributes include age, gender, headPose, smile, facialHair, glasses, - emotion, hair, makeup, occlusion, accessories, blur, exposure and - noise. Some of the results returned for specific attributes may not be - highly accurate. + emotion, hair, makeup, occlusion, accessories, blur, exposure, noise, + and mask. Some of the results returned for specific attributes may not + be highly accurate. * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. * Up to 100 faces can be returned for an image. Faces are ranked by face rectangle size from large to small. * For optimal results when querying [Face - - Identify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395239), + Identify](https://docs.microsoft.com/rest/api/faceapi/face/identify), [Face - - Verify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039523a), + Verify](https://docs.microsoft.com/rest/api/faceapi/face/verifyfacetoface), and [Face - Find - Similar](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395237) + Similar](https://docs.microsoft.com/rest/api/faceapi/face/findsimilar) ('returnFaceId' is true), please use faces that are: frontal, clear, and with a minimum size of 200x200 pixels (100 pixels between eyes). * The minimum detectable face size is 36x36 pixels in an image no @@ -430,34 +433,16 @@ def detect_with_url( 1920x1080 pixels will need a proportionally larger minimum face size. * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer to [How to specify a detection - model](https://docs.microsoft.com/en-us/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model) - | Model | Recommended use-case(s) | - | ---------- | -------- | - | 'detection_01': | The default detection model for [Face - - Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236). - Recommend for near frontal face detection. For scenarios with - exceptionally large angle (head-pose) faces, occluded faces or wrong - image orientation, the faces in such cases may not be detected. | - | 'detection_02': | Detection model released in 2019 May with improved - accuracy especially on small, side and blurry faces. | + model](https://docs.microsoft.com/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model). * Different 'recognitionModel' values are provided. If follow-up operations like Verify, Identify, Find Similar are needed, please specify the recognition model with 'recognitionModel' parameter. The default value for 'recognitionModel' is 'recognition_01', if latest model needed, please explicitly specify the model you need in this parameter. Once specified, the detected faceIds will be associated with - the specified recognition model. More details, please refer to [How to - specify a recognition - model](https://docs.microsoft.com/en-us/azure/cognitive-services/face/face-api-how-to-topics/specify-recognition-model) - | Model | Recommended use-case(s) | - | ---------- | -------- | - | 'recognition_01': | The default recognition model for [Face - - Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236). - All those faceIds created before 2019 March are bonded with this - recognition model. | - | 'recognition_02': | Recognition model released in 2019 March. - 'recognition_02' is recommended since its overall accuracy is improved - compared with 'recognition_01'. |. + the specified recognition model. More details, please refer to [Specify + a recognition + model](https://docs.microsoft.com/azure/cognitive-services/face/face-api-how-to-topics/specify-recognition-model). :param url: Publicly reachable URL of an image :type url: str @@ -469,10 +454,13 @@ def detect_with_url( :type return_face_landmarks: bool :param return_face_attributes: Analyze and return the one or more specified face attributes in the comma-separated string like - "returnFaceAttributes=age,gender". Supported face attributes include - age, gender, headPose, smile, facialHair, glasses and emotion. Note - that each face attribute analysis has additional computational and - time cost. + "returnFaceAttributes=age,gender". The available attributes depends on + the 'detectionModel' specified. 'detection_01' supports age, gender, + headPose, smile, facialHair, glasses, emotion, hair, makeup, + occlusion, accessories, blur, exposure, and noise. While + 'detection_02' does not support any attributes and 'detection_03' only + supports mask. Note that each face attribute analysis has additional + computational and time cost. :type return_face_attributes: list[str or ~azure.cognitiveservices.vision.face.models.FaceAttributeType] :param recognition_model: Name of recognition model. Recognition model @@ -482,7 +470,7 @@ def detect_with_url( (Large)FaceList - Create or (Large)PersonGroup - Create. The default value is 'recognition_01', if latest model needed, please explicitly specify the model you need. Possible values include: 'recognition_01', - 'recognition_02' + 'recognition_02', 'recognition_03', 'recognition_04' :type recognition_model: str or ~azure.cognitiveservices.vision.face.models.RecognitionModel :param return_recognition_model: A value indicating whether the @@ -493,9 +481,14 @@ def detect_with_url( can be provided when performing Face - Detect or (Large)FaceList - Add Face or (Large)PersonGroup - Add Face. The default value is 'detection_01', if another model is needed, please explicitly specify - it. Possible values include: 'detection_01', 'detection_02' + it. Possible values include: 'detection_01', 'detection_02', + 'detection_03' :type detection_model: str or ~azure.cognitiveservices.vision.face.models.DetectionModel + :param face_id_time_to_live: The number of seconds for the faceId + being cached. Supported range from 60 seconds up to 86400 seconds. The + default value is 86400 (24 hours). + :type face_id_time_to_live: int :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -530,6 +523,8 @@ def detect_with_url( query_parameters['returnRecognitionModel'] = self._serialize.query("return_recognition_model", return_recognition_model, 'bool') if detection_model is not None: query_parameters['detectionModel'] = self._serialize.query("detection_model", detection_model, 'str') + if face_id_time_to_live is not None: + query_parameters['faceIdTimeToLive'] = self._serialize.query("face_id_time_to_live", face_id_time_to_live, 'int', maximum=86400, minimum=60) # Construct headers header_parameters = {} @@ -632,34 +627,34 @@ def verify_face_to_person( verify_face_to_person.metadata = {'url': '/verify'} def detect_with_stream( - self, image, return_face_id=True, return_face_landmarks=False, return_face_attributes=None, recognition_model="recognition_01", return_recognition_model=False, detection_model="detection_01", custom_headers=None, raw=False, callback=None, **operation_config): + self, image, return_face_id=True, return_face_landmarks=False, return_face_attributes=None, recognition_model="recognition_01", return_recognition_model=False, detection_model="detection_01", face_id_time_to_live=86400, custom_headers=None, raw=False, callback=None, **operation_config): """Detect human faces in an image, return face rectangles, and optionally with faceIds, landmarks, and attributes.
* No image will be stored. Only the extracted face feature will be stored on server. The faceId is an identifier of the face feature and will be used in [Face - - Identify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395239), + Identify](https://docs.microsoft.com/rest/api/faceapi/face/identify), [Face - - Verify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039523a), + Verify](https://docs.microsoft.com/rest/api/faceapi/face/verifyfacetoface), and [Face - Find - Similar](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395237). - The stored face feature(s) will expire and be deleted 24 hours after - the original detection call. + Similar](https://docs.microsoft.com/rest/api/faceapi/face/findsimilar). + The stored face feature(s) will expire and be deleted at the time + specified by faceIdTimeToLive after the original detection call. * Optional parameters include faceId, landmarks, and attributes. Attributes include age, gender, headPose, smile, facialHair, glasses, - emotion, hair, makeup, occlusion, accessories, blur, exposure and - noise. Some of the results returned for specific attributes may not be - highly accurate. + emotion, hair, makeup, occlusion, accessories, blur, exposure, noise, + and mask. Some of the results returned for specific attributes may not + be highly accurate. * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. * Up to 100 faces can be returned for an image. Faces are ranked by face rectangle size from large to small. * For optimal results when querying [Face - - Identify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395239), + Identify](https://docs.microsoft.com/rest/api/faceapi/face/identify), [Face - - Verify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039523a), + Verify](https://docs.microsoft.com/rest/api/faceapi/face/verifyfacetoface), and [Face - Find - Similar](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395237) + Similar](https://docs.microsoft.com/rest/api/faceapi/face/findsimilar) ('returnFaceId' is true), please use faces that are: frontal, clear, and with a minimum size of 200x200 pixels (100 pixels between eyes). * The minimum detectable face size is 36x36 pixels in an image no @@ -667,34 +662,16 @@ def detect_with_stream( 1920x1080 pixels will need a proportionally larger minimum face size. * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer to [How to specify a detection - model](https://docs.microsoft.com/en-us/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model) - | Model | Recommended use-case(s) | - | ---------- | -------- | - | 'detection_01': | The default detection model for [Face - - Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236). - Recommend for near frontal face detection. For scenarios with - exceptionally large angle (head-pose) faces, occluded faces or wrong - image orientation, the faces in such cases may not be detected. | - | 'detection_02': | Detection model released in 2019 May with improved - accuracy especially on small, side and blurry faces. | + model](https://docs.microsoft.com/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model) * Different 'recognitionModel' values are provided. If follow-up operations like Verify, Identify, Find Similar are needed, please specify the recognition model with 'recognitionModel' parameter. The default value for 'recognitionModel' is 'recognition_01', if latest model needed, please explicitly specify the model you need in this parameter. Once specified, the detected faceIds will be associated with - the specified recognition model. More details, please refer to [How to - specify a recognition - model](https://docs.microsoft.com/en-us/azure/cognitive-services/face/face-api-how-to-topics/specify-recognition-model) - | Model | Recommended use-case(s) | - | ---------- | -------- | - | 'recognition_01': | The default recognition model for [Face - - Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236). - All those faceIds created before 2019 March are bonded with this - recognition model. | - | 'recognition_02': | Recognition model released in 2019 March. - 'recognition_02' is recommended since its overall accuracy is improved - compared with 'recognition_01'. |. + the specified recognition model. More details, please refer to [Specify + a recognition + model](https://docs.microsoft.com/azure/cognitive-services/face/face-api-how-to-topics/specify-recognition-model). :param image: An image stream. :type image: Generator @@ -706,10 +683,13 @@ def detect_with_stream( :type return_face_landmarks: bool :param return_face_attributes: Analyze and return the one or more specified face attributes in the comma-separated string like - "returnFaceAttributes=age,gender". Supported face attributes include - age, gender, headPose, smile, facialHair, glasses and emotion. Note - that each face attribute analysis has additional computational and - time cost. + "returnFaceAttributes=age,gender". The available attributes depends on + the 'detectionModel' specified. 'detection_01' supports age, gender, + headPose, smile, facialHair, glasses, emotion, hair, makeup, + occlusion, accessories, blur, exposure, and noise. While + 'detection_02' does not support any attributes and 'detection_03' only + supports mask. Note that each face attribute analysis has additional + computational and time cost. :type return_face_attributes: list[str or ~azure.cognitiveservices.vision.face.models.FaceAttributeType] :param recognition_model: Name of recognition model. Recognition model @@ -719,7 +699,7 @@ def detect_with_stream( (Large)FaceList - Create or (Large)PersonGroup - Create. The default value is 'recognition_01', if latest model needed, please explicitly specify the model you need. Possible values include: 'recognition_01', - 'recognition_02' + 'recognition_02', 'recognition_03', 'recognition_04' :type recognition_model: str or ~azure.cognitiveservices.vision.face.models.RecognitionModel :param return_recognition_model: A value indicating whether the @@ -730,9 +710,14 @@ def detect_with_stream( can be provided when performing Face - Detect or (Large)FaceList - Add Face or (Large)PersonGroup - Add Face. The default value is 'detection_01', if another model is needed, please explicitly specify - it. Possible values include: 'detection_01', 'detection_02' + it. Possible values include: 'detection_01', 'detection_02', + 'detection_03' :type detection_model: str or ~azure.cognitiveservices.vision.face.models.DetectionModel + :param face_id_time_to_live: The number of seconds for the faceId + being cached. Supported range from 60 seconds up to 86400 seconds. The + default value is 86400 (24 hours). + :type face_id_time_to_live: int :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -770,6 +755,8 @@ def detect_with_stream( query_parameters['returnRecognitionModel'] = self._serialize.query("return_recognition_model", return_recognition_model, 'bool') if detection_model is not None: query_parameters['detectionModel'] = self._serialize.query("detection_model", detection_model, 'str') + if face_id_time_to_live is not None: + query_parameters['faceIdTimeToLive'] = self._serialize.query("face_id_time_to_live", face_id_time_to_live, 'int', maximum=86400, minimum=60) # Construct headers header_parameters = {} diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-face/azure/cognitiveservices/vision/face/operations/_large_face_list_operations.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-face/azure/cognitiveservices/vision/face/operations/_large_face_list_operations.py index 225794573afc..6342b5b1f709 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-face/azure/cognitiveservices/vision/face/operations/_large_face_list_operations.py +++ b/sdk/cognitiveservices/azure-cognitiveservices-vision-face/azure/cognitiveservices/vision/face/operations/_large_face_list_operations.py @@ -41,25 +41,25 @@ def create( name, an optional userData and recognitionModel.
Large face list is a list of faces, up to 1,000,000 faces, and used by [Face - Find - Similar](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395237). + Similar](https://docs.microsoft.com/rest/api/faceapi/face/findsimilar).
After creation, user should use [LargeFaceList Face - - Add](/docs/services/563879b61984550e40cbbe8d/operations/5a158c10d2de3616c086f2d3) + Add](https://docs.microsoft.com/rest/api/faceapi/largefacelist/addfacefromurl) to import the faces and [LargeFaceList - - Train](/docs/services/563879b61984550e40cbbe8d/operations/5a158422d2de3616c086f2d1) + Train](https://docs.microsoft.com/rest/api/faceapi/largefacelist/train) to make it ready for [Face - Find - Similar](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395237). + Similar](https://docs.microsoft.com/rest/api/faceapi/face/findsimilar). No image will be stored. Only the extracted face features are stored on server until [LargeFaceList - - Delete](/docs/services/563879b61984550e40cbbe8d/operations/5a1580d5d2de3616c086f2cd) + Delete](https://docs.microsoft.com/rest/api/faceapi/largefacelist/delete) is called.
Find Similar is used for scenario like finding celebrity-like faces, similar face filtering, or as a light way face identification. But if the actual use is to identify person, please use - [PersonGroup](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395244) + [PersonGroup](https://docs.microsoft.com/rest/api/faceapi/persongroup) / - [LargePersonGroup](/docs/services/563879b61984550e40cbbe8d/operations/599acdee6ac60f11b48b5a9d) + [LargePersonGroup](https://docs.microsoft.com/rest/api/faceapi/largepersongroup) and [Face - - Identify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395239). + Identify](https://docs.microsoft.com/rest/api/faceapi/face/identify).
'recognitionModel' should be specified to associate with this large face list. The default value for 'recognitionModel' is 'recognition_01', if the latest model needed, please explicitly specify @@ -67,14 +67,8 @@ def create( existing large face list will use the recognition model that's already associated with the collection. Existing face features in a large face list can't be updated to features extracted by another version of - recognition model. - * 'recognition_01': The default recognition model for [LargeFaceList- - Create](/docs/services/563879b61984550e40cbbe8d/operations/5a157b68d2de3616c086f2cc). - All those large face lists created before 2019 March are bonded with - this recognition model. - * 'recognition_02': Recognition model released in 2019 March. - 'recognition_02' is recommended since its overall accuracy is improved - compared with 'recognition_01'. + recognition model. Please refer to [Specify a recognition + model](https://docs.microsoft.com/azure/cognitive-services/face/face-api-how-to-topics/specify-recognition-model). Large face list quota: * Free-tier subscription quota: 64 large face lists. * S0-tier subscription quota: 1,000,000 large face lists. @@ -87,7 +81,7 @@ def create( :param user_data: User specified data. Length should not exceed 16KB. :type user_data: str :param recognition_model: Possible values include: 'recognition_01', - 'recognition_02' + 'recognition_02', 'recognition_03', 'recognition_04' :type recognition_model: str or ~azure.cognitiveservices.vision.face.models.RecognitionModel :param dict custom_headers: headers that will be added to the request @@ -352,7 +346,7 @@ def list( """List large face lists’ information of largeFaceListId, name, userData and recognitionModel.
To get face information inside largeFaceList use [LargeFaceList Face - - Get](/docs/services/563879b61984550e40cbbe8d/operations/5a158cf2d2de3616c086f2d5)
* Large face lists are stored in alphabetical order of largeFaceListId. * "start" parameter (string, optional) is a user-provided @@ -644,13 +638,13 @@ def add_face_from_url( persistedFaceId representing the added face. No image will be stored. Only the extracted face feature will be stored on server until [LargeFaceList Face - - Delete](/docs/services/563879b61984550e40cbbe8d/operations/5a158c8ad2de3616c086f2d4) + Delete](https://docs.microsoft.com/rest/api/faceapi/largefacelist/deleteface) or [LargeFaceList - - Delete](/docs/services/563879b61984550e40cbbe8d/operations/5a1580d5d2de3616c086f2cd) + Delete](https://docs.microsoft.com/rest/api/faceapi/largefacelist/delete) is called.
Note persistedFaceId is different from faceId generated by [Face - - Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236). + Detect](https://docs.microsoft.com/rest/api/faceapi/face/detectwithurl). * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. @@ -659,7 +653,7 @@ def add_face_from_url( * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the provided "targetFace" rectangle is not returned from [Face - - Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236), + Detect](https://docs.microsoft.com/rest/api/faceapi/face/detectwithurl), there’s no guarantee to detect and add the face successfully. * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause failures. @@ -670,17 +664,7 @@ def add_face_from_url( 1920x1080 pixels will need a proportionally larger minimum face size. * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer to [How to specify a detection - model](https://docs.microsoft.com/en-us/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model) - | Model | Recommended use-case(s) | - | ---------- | -------- | - | 'detection_01': | The default detection model for [LargeFaceList - - Add - Face](/docs/services/563879b61984550e40cbbe8d/operations/5a158c10d2de3616c086f2d3). - Recommend for near frontal face detection. For scenarios with - exceptionally large angle (head-pose) faces, occluded faces or wrong - image orientation, the faces in such cases may not be detected. | - | 'detection_02': | Detection model released in 2019 May with improved - accuracy especially on small, side and blurry faces. | + model](https://docs.microsoft.com/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model) Quota: * Free-tier subscription quota: 1,000 faces per large face list. * S0-tier subscription quota: 1,000,000 faces per large face list. @@ -704,7 +688,8 @@ def add_face_from_url( can be provided when performing Face - Detect or (Large)FaceList - Add Face or (Large)PersonGroup - Add Face. The default value is 'detection_01', if another model is needed, please explicitly specify - it. Possible values include: 'detection_01', 'detection_02' + it. Possible values include: 'detection_01', 'detection_02', + 'detection_03' :type detection_model: str or ~azure.cognitiveservices.vision.face.models.DetectionModel :param dict custom_headers: headers that will be added to the request @@ -839,13 +824,13 @@ def add_face_from_stream( persistedFaceId representing the added face. No image will be stored. Only the extracted face feature will be stored on server until [LargeFaceList Face - - Delete](/docs/services/563879b61984550e40cbbe8d/operations/5a158c8ad2de3616c086f2d4) + Delete](https://docs.microsoft.com/rest/api/faceapi/largefacelist/deleteface) or [LargeFaceList - - Delete](/docs/services/563879b61984550e40cbbe8d/operations/5a1580d5d2de3616c086f2cd) + Delete](https://docs.microsoft.com/rest/api/faceapi/largefacelist/delete) is called.
Note persistedFaceId is different from faceId generated by [Face - - Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236). + Detect](https://docs.microsoft.com/rest/api/faceapi/face/detectwithurl). * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. @@ -854,7 +839,7 @@ def add_face_from_stream( * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the provided "targetFace" rectangle is not returned from [Face - - Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236), + Detect](https://docs.microsoft.com/rest/api/faceapi/face/detectwithurl), there’s no guarantee to detect and add the face successfully. * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause failures. @@ -865,17 +850,7 @@ def add_face_from_stream( 1920x1080 pixels will need a proportionally larger minimum face size. * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer to [How to specify a detection - model](https://docs.microsoft.com/en-us/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model) - | Model | Recommended use-case(s) | - | ---------- | -------- | - | 'detection_01': | The default detection model for [LargeFaceList - - Add - Face](/docs/services/563879b61984550e40cbbe8d/operations/5a158c10d2de3616c086f2d3). - Recommend for near frontal face detection. For scenarios with - exceptionally large angle (head-pose) faces, occluded faces or wrong - image orientation, the faces in such cases may not be detected. | - | 'detection_02': | Detection model released in 2019 May with improved - accuracy especially on small, side and blurry faces. | + model](https://docs.microsoft.com/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model). Quota: * Free-tier subscription quota: 1,000 faces per large face list. * S0-tier subscription quota: 1,000,000 faces per large face list. @@ -899,7 +874,8 @@ def add_face_from_stream( can be provided when performing Face - Detect or (Large)FaceList - Add Face or (Large)PersonGroup - Add Face. The default value is 'detection_01', if another model is needed, please explicitly specify - it. Possible values include: 'detection_01', 'detection_02' + it. Possible values include: 'detection_01', 'detection_02', + 'detection_03' :type detection_model: str or ~azure.cognitiveservices.vision.face.models.DetectionModel :param dict custom_headers: headers that will be added to the request diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-face/azure/cognitiveservices/vision/face/operations/_large_person_group_operations.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-face/azure/cognitiveservices/vision/face/operations/_large_person_group_operations.py index 4eb2a64c7dc5..e1c5a238ae9d 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-face/azure/cognitiveservices/vision/face/operations/_large_person_group_operations.py +++ b/sdk/cognitiveservices/azure-cognitiveservices-vision-face/azure/cognitiveservices/vision/face/operations/_large_person_group_operations.py @@ -43,17 +43,17 @@ def create( data, including face recognition feature, and up to 1,000,000 people.
After creation, use [LargePersonGroup Person - - Create](/docs/services/563879b61984550e40cbbe8d/operations/599adcba3a7b9412a4d53f40) + Create](https://docs.microsoft.com/rest/api/faceapi/largepersongroupperson/create) to add person into the group, and call [LargePersonGroup - - Train](/docs/services/563879b61984550e40cbbe8d/operations/599ae2d16ac60f11b48b5aa4) + Train](https://docs.microsoft.com/rest/api/faceapi/largepersongroup/train) to get this group ready for [Face - - Identify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395239). + Identify](https://docs.microsoft.com/rest/api/faceapi/face/identify).
No image will be stored. Only the person's extracted face features and userData will be stored on server until [LargePersonGroup Person - - Delete](/docs/services/563879b61984550e40cbbe8d/operations/599ade5c6ac60f11b48b5aa2) + Delete](https://docs.microsoft.com/rest/api/faceapi/largepersongroupperson/delete) or [LargePersonGroup - - Delete](/docs/services/563879b61984550e40cbbe8d/operations/599adc216ac60f11b48b5a9f) + Delete](https://docs.microsoft.com/rest/api/faceapi/largepersongroup/delete) is called.
'recognitionModel' should be specified to associate with this large person group. The default value for 'recognitionModel' is @@ -62,15 +62,9 @@ def create( existing large person group will use the recognition model that's already associated with the collection. Existing face features in a large person group can't be updated to features extracted by another - version of recognition model. - * 'recognition_01': The default recognition model for [LargePersonGroup - - - Create](/docs/services/563879b61984550e40cbbe8d/operations/599acdee6ac60f11b48b5a9d). - All those large person groups created before 2019 March are bonded with - this recognition model. - * 'recognition_02': Recognition model released in 2019 March. - 'recognition_02' is recommended since its overall accuracy is improved - compared with 'recognition_01'. + version of recognition model. Please refer to [Specify a face + recognition + model](https://docs.microsoft.com/azure/cognitive-services/face/face-api-how-to-topics/specify-recognition-model). Large person group quota: * Free-tier subscription quota: 1,000 large person groups. * S0-tier subscription quota: 1,000,000 large person groups. @@ -83,7 +77,7 @@ def create( :param user_data: User specified data. Length should not exceed 16KB. :type user_data: str :param recognition_model: Possible values include: 'recognition_01', - 'recognition_02' + 'recognition_02', 'recognition_03', 'recognition_04' :type recognition_model: str or ~azure.cognitiveservices.vision.face.models.RecognitionModel :param dict custom_headers: headers that will be added to the request @@ -181,7 +175,7 @@ def get( """Retrieve the information of a large person group, including its name, userData and recognitionModel. This API returns large person group information only, use [LargePersonGroup Person - - List](/docs/services/563879b61984550e40cbbe8d/operations/599adda06ac60f11b48b5aa1) + List](https://docs.microsoft.com/rest/api/faceapi/largepersongroupperson/list) instead to retrieve person information under the large person group. . diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-face/azure/cognitiveservices/vision/face/operations/_large_person_group_person_operations.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-face/azure/cognitiveservices/vision/face/operations/_large_person_group_person_operations.py index 2e5dc3ffcee8..4c96d556be59 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-face/azure/cognitiveservices/vision/face/operations/_large_person_group_person_operations.py +++ b/sdk/cognitiveservices/azure-cognitiveservices-vision-face/azure/cognitiveservices/vision/face/operations/_large_person_group_person_operations.py @@ -514,15 +514,15 @@ def add_face_from_url( rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted face feature will be stored on server until [LargePersonGroup PersonFace - - Delete](/docs/services/563879b61984550e40cbbe8d/operations/599ae2966ac60f11b48b5aa3), + Delete](https://docs.microsoft.com/rest/api/faceapi/largepersongroupperson/deleteface), [LargePersonGroup Person - - Delete](/docs/services/563879b61984550e40cbbe8d/operations/599ade5c6ac60f11b48b5aa2) + Delete](https://docs.microsoft.com/rest/api/faceapi/largepersongroupperson/delete) or [LargePersonGroup - - Delete](/docs/services/563879b61984550e40cbbe8d/operations/599adc216ac60f11b48b5a9f) + Delete](https://docs.microsoft.com/rest/api/faceapi/largepersongroup/delete) is called.
Note persistedFaceId is different from faceId generated by [Face - - Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236). + Detect](https://docs.microsoft.com/rest/api/faceapi/face/detectwithurl). * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. @@ -532,7 +532,7 @@ def add_face_from_url( * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the provided "targetFace" rectangle is not returned from [Face - - Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236), + Detect](https://docs.microsoft.com/rest/api/faceapi/face/detectwithurl), there’s no guarantee to detect and add the face successfully. * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause failures. @@ -544,17 +544,7 @@ def add_face_from_url( 1920x1080 pixels will need a proportionally larger minimum face size. * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer to [How to specify a detection - model](https://docs.microsoft.com/en-us/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model) - | Model | Recommended use-case(s) | - | ---------- | -------- | - | 'detection_01': | The default detection model for [LargePersonGroup - Person - Add - Face](/docs/services/563879b61984550e40cbbe8d/operations/599adf2a3a7b9412a4d53f42). - Recommend for near frontal face detection. For scenarios with - exceptionally large angle (head-pose) faces, occluded faces or wrong - image orientation, the faces in such cases may not be detected. | - | 'detection_02': | Detection model released in 2019 May with improved - accuracy especially on small, side and blurry faces. |. + model](https://docs.microsoft.com/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model). :param large_person_group_id: Id referencing a particular large person group. @@ -577,7 +567,8 @@ def add_face_from_url( can be provided when performing Face - Detect or (Large)FaceList - Add Face or (Large)PersonGroup - Add Face. The default value is 'detection_01', if another model is needed, please explicitly specify - it. Possible values include: 'detection_01', 'detection_02' + it. Possible values include: 'detection_01', 'detection_02', + 'detection_03' :type detection_model: str or ~azure.cognitiveservices.vision.face.models.DetectionModel :param dict custom_headers: headers that will be added to the request @@ -647,15 +638,15 @@ def add_face_from_stream( rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted face feature will be stored on server until [LargePersonGroup PersonFace - - Delete](/docs/services/563879b61984550e40cbbe8d/operations/599ae2966ac60f11b48b5aa3), + Delete](https://docs.microsoft.com/rest/api/faceapi/largepersongroupperson/deleteface), [LargePersonGroup Person - - Delete](/docs/services/563879b61984550e40cbbe8d/operations/599ade5c6ac60f11b48b5aa2) + Delete](https://docs.microsoft.com/rest/api/faceapi/largepersongroupperson/delete) or [LargePersonGroup - - Delete](/docs/services/563879b61984550e40cbbe8d/operations/599adc216ac60f11b48b5a9f) + Delete](https://docs.microsoft.com/rest/api/faceapi/largepersongroup/delete) is called.
Note persistedFaceId is different from faceId generated by [Face - - Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236). + Detect](https://docs.microsoft.com/rest/api/faceapi/face/detectwithurl). * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. @@ -665,7 +656,7 @@ def add_face_from_stream( * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the provided "targetFace" rectangle is not returned from [Face - - Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236), + Detect](https://docs.microsoft.com/rest/api/faceapi/face/detectwithurl), there’s no guarantee to detect and add the face successfully. * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause failures. @@ -677,17 +668,7 @@ def add_face_from_stream( 1920x1080 pixels will need a proportionally larger minimum face size. * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer to [How to specify a detection - model](https://docs.microsoft.com/en-us/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model) - | Model | Recommended use-case(s) | - | ---------- | -------- | - | 'detection_01': | The default detection model for [LargePersonGroup - Person - Add - Face](/docs/services/563879b61984550e40cbbe8d/operations/599adf2a3a7b9412a4d53f42). - Recommend for near frontal face detection. For scenarios with - exceptionally large angle (head-pose) faces, occluded faces or wrong - image orientation, the faces in such cases may not be detected. | - | 'detection_02': | Detection model released in 2019 May with improved - accuracy especially on small, side and blurry faces. |. + model](https://docs.microsoft.com/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model). :param large_person_group_id: Id referencing a particular large person group. @@ -710,7 +691,8 @@ def add_face_from_stream( can be provided when performing Face - Detect or (Large)FaceList - Add Face or (Large)PersonGroup - Add Face. The default value is 'detection_01', if another model is needed, please explicitly specify - it. Possible values include: 'detection_01', 'detection_02' + it. Possible values include: 'detection_01', 'detection_02', + 'detection_03' :type detection_model: str or ~azure.cognitiveservices.vision.face.models.DetectionModel :param dict custom_headers: headers that will be added to the request diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-face/azure/cognitiveservices/vision/face/operations/_person_group_operations.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-face/azure/cognitiveservices/vision/face/operations/_person_group_operations.py index 66cf2d6ca01c..1c911d27dea8 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-face/azure/cognitiveservices/vision/face/operations/_person_group_operations.py +++ b/sdk/cognitiveservices/azure-cognitiveservices-vision-face/azure/cognitiveservices/vision/face/operations/_person_group_operations.py @@ -42,17 +42,17 @@ def create(
A person group is the container of the uploaded person data, including face recognition features.
After creation, use [PersonGroup Person - - Create](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039523c) + Create](https://docs.microsoft.com/rest/api/faceapi/persongroupperson/create) to add persons into the group, and then call [PersonGroup - - Train](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395249) + Train](https://docs.microsoft.com/rest/api/faceapi/persongroup/train) to get this group ready for [Face - - Identify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395239). + Identify](https://docs.microsoft.com/rest/api/faceapi/face/identify).
No image will be stored. Only the person's extracted face features and userData will be stored on server until [PersonGroup Person - - Delete](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039523d) + Delete](https://docs.microsoft.com/rest/api/faceapi/persongroupperson/delete) or [PersonGroup - - Delete](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395245) + Delete](https://docs.microsoft.com/rest/api/faceapi/persongroup/delete) is called.
'recognitionModel' should be specified to associate with this person group. The default value for 'recognitionModel' is @@ -62,13 +62,6 @@ def create( associated with the collection. Existing face features in a person group can't be updated to features extracted by another version of recognition model. - * 'recognition_01': The default recognition model for [PersonGroup - - Create](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395244). - All those person groups created before 2019 March are bonded with this - recognition model. - * 'recognition_02': Recognition model released in 2019 March. - 'recognition_02' is recommended since its overall accuracy is improved - compared with 'recognition_01'. Person group quota: * Free-tier subscription quota: 1,000 person groups. Each holds up to 1,000 persons. @@ -76,7 +69,7 @@ def create( 10,000 persons. * to handle larger scale face identification problem, please consider using - [LargePersonGroup](/docs/services/563879b61984550e40cbbe8d/operations/599acdee6ac60f11b48b5a9d). + [LargePersonGroup](https://docs.microsoft.com/rest/api/faceapi/largepersongroup). :param person_group_id: Id referencing a particular person group. :type person_group_id: str @@ -85,7 +78,7 @@ def create( :param user_data: User specified data. Length should not exceed 16KB. :type user_data: str :param recognition_model: Possible values include: 'recognition_01', - 'recognition_02' + 'recognition_02', 'recognition_03', 'recognition_04' :type recognition_model: str or ~azure.cognitiveservices.vision.face.models.RecognitionModel :param dict custom_headers: headers that will be added to the request @@ -181,7 +174,7 @@ def get( self, person_group_id, return_recognition_model=False, custom_headers=None, raw=False, **operation_config): """Retrieve person group name, userData and recognitionModel. To get person information under this personGroup, use [PersonGroup Person - - List](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395241). + List](https://docs.microsoft.com/rest/api/faceapi/persongroupperson/list). :param person_group_id: Id referencing a particular person group. :type person_group_id: str diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-face/azure/cognitiveservices/vision/face/operations/_person_group_person_operations.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-face/azure/cognitiveservices/vision/face/operations/_person_group_person_operations.py index 3d62f95c7cee..589796aa64c6 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-face/azure/cognitiveservices/vision/face/operations/_person_group_person_operations.py +++ b/sdk/cognitiveservices/azure-cognitiveservices-vision-face/azure/cognitiveservices/vision/face/operations/_person_group_person_operations.py @@ -446,15 +446,15 @@ def update_face( persistedFaceId representing the added face. No image will be stored. Only the extracted face feature will be stored on server until [PersonGroup PersonFace - - Delete](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039523e), + Delete](https://docs.microsoft.com/rest/api/faceapi/persongroupperson/deleteface), [PersonGroup Person - - Delete](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039523d) + Delete](https://docs.microsoft.com/rest/api/faceapi/persongroupperson/delete) or [PersonGroup - - Delete](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395245) + Delete](https://docs.microsoft.com/rest/api/faceapi/persongroup/delete) is called.
Note persistedFaceId is different from faceId generated by [Face - - Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236). + Detect](https://docs.microsoft.com/rest/api/faceapi/face/detectwithurl). * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. @@ -464,7 +464,7 @@ def update_face( * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the provided "targetFace" rectangle is not returned from [Face - - Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236), + Detect](https://docs.microsoft.com/rest/api/faceapi/face/detectwithurl), there’s no guarantee to detect and add the face successfully. * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause failures. @@ -536,15 +536,15 @@ def add_face_from_url( persistedFaceId representing the added face. No image will be stored. Only the extracted face feature will be stored on server until [PersonGroup PersonFace - - Delete](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039523e), + Delete](https://docs.microsoft.com/rest/api/faceapi/persongroupperson/deleteface), [PersonGroup Person - - Delete](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039523d) + Delete](https://docs.microsoft.com/rest/api/faceapi/persongroupperson/delete) or [PersonGroup - - Delete](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395245) + Delete](https://docs.microsoft.com/rest/api/faceapi/persongroup/delete) is called.
Note persistedFaceId is different from faceId generated by [Face - - Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236). + Detect](https://docs.microsoft.com/rest/api/faceapi/face/detectwithurl). * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. @@ -554,7 +554,7 @@ def add_face_from_url( * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the provided "targetFace" rectangle is not returned from [Face - - Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236), + Detect](https://docs.microsoft.com/rest/api/faceapi/face/detectwithurl), there’s no guarantee to detect and add the face successfully. * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause failures. @@ -566,17 +566,7 @@ def add_face_from_url( 1920x1080 pixels will need a proportionally larger minimum face size. * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer to [How to specify a detection - model](https://docs.microsoft.com/en-us/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model) - | Model | Recommended use-case(s) | - | ---------- | -------- | - | 'detection_01': | The default detection model for [PersonGroup Person - - Add - Face](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039523b). - Recommend for near frontal face detection. For scenarios with - exceptionally large angle (head-pose) faces, occluded faces or wrong - image orientation, the faces in such cases may not be detected. | - | 'detection_02': | Detection model released in 2019 May with improved - accuracy especially on small, side and blurry faces. |. + model](https://docs.microsoft.com/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model). :param person_group_id: Id referencing a particular person group. :type person_group_id: str @@ -598,7 +588,8 @@ def add_face_from_url( can be provided when performing Face - Detect or (Large)FaceList - Add Face or (Large)PersonGroup - Add Face. The default value is 'detection_01', if another model is needed, please explicitly specify - it. Possible values include: 'detection_01', 'detection_02' + it. Possible values include: 'detection_01', 'detection_02', + 'detection_03' :type detection_model: str or ~azure.cognitiveservices.vision.face.models.DetectionModel :param dict custom_headers: headers that will be added to the request @@ -668,15 +659,15 @@ def add_face_from_stream( persistedFaceId representing the added face. No image will be stored. Only the extracted face feature will be stored on server until [PersonGroup PersonFace - - Delete](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039523e), + Delete](https://docs.microsoft.com/rest/api/faceapi/persongroupperson/deleteface), [PersonGroup Person - - Delete](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039523d) + Delete](https://docs.microsoft.com/rest/api/faceapi/persongroupperson/delete) or [PersonGroup - - Delete](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395245) + Delete](https://docs.microsoft.com/rest/api/faceapi/persongroup/delete) is called.
Note persistedFaceId is different from faceId generated by [Face - - Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236). + Detect](https://docs.microsoft.com/rest/api/faceapi/face/detectwithurl). * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. @@ -686,7 +677,7 @@ def add_face_from_stream( * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the provided "targetFace" rectangle is not returned from [Face - - Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236), + Detect](https://docs.microsoft.com/rest/api/faceapi/face/detectwithurl), there’s no guarantee to detect and add the face successfully. * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause failures. @@ -698,17 +689,7 @@ def add_face_from_stream( 1920x1080 pixels will need a proportionally larger minimum face size. * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer to [How to specify a detection - model](https://docs.microsoft.com/en-us/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model) - | Model | Recommended use-case(s) | - | ---------- | -------- | - | 'detection_01': | The default detection model for [PersonGroup Person - - Add - Face](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039523b). - Recommend for near frontal face detection. For scenarios with - exceptionally large angle (head-pose) faces, occluded faces or wrong - image orientation, the faces in such cases may not be detected. | - | 'detection_02': | Detection model released in 2019 May with improved - accuracy especially on small, side and blurry faces. |. + model](https://docs.microsoft.com/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model). :param person_group_id: Id referencing a particular person group. :type person_group_id: str @@ -730,7 +711,8 @@ def add_face_from_stream( can be provided when performing Face - Detect or (Large)FaceList - Add Face or (Large)PersonGroup - Add Face. The default value is 'detection_01', if another model is needed, please explicitly specify - it. Possible values include: 'detection_01', 'detection_02' + it. Possible values include: 'detection_01', 'detection_02', + 'detection_03' :type detection_model: str or ~azure.cognitiveservices.vision.face.models.DetectionModel :param dict custom_headers: headers that will be added to the request