Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[AutoPR cognitiveservices/data-plane/Face] [Cogs Face] Align with latest released version of Face API with million-scale features. #3049

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
from .operations.person_group_person_operations import PersonGroupPersonOperations
from .operations.person_group_operations import PersonGroupOperations
from .operations.face_list_operations import FaceListOperations
from .operations.large_person_group_person_operations import LargePersonGroupPersonOperations
from .operations.large_person_group_operations import LargePersonGroupOperations
from .operations.large_face_list_operations import LargeFaceListOperations
from . import models


Expand Down Expand Up @@ -63,6 +66,12 @@ class FaceClient(SDKClient):
:vartype person_group: azure.cognitiveservices.vision.face.operations.PersonGroupOperations
:ivar face_list: FaceList operations
:vartype face_list: azure.cognitiveservices.vision.face.operations.FaceListOperations
:ivar large_person_group_person: LargePersonGroupPerson operations
:vartype large_person_group_person: azure.cognitiveservices.vision.face.operations.LargePersonGroupPersonOperations
:ivar large_person_group: LargePersonGroup operations
:vartype large_person_group: azure.cognitiveservices.vision.face.operations.LargePersonGroupOperations
:ivar large_face_list: LargeFaceList operations
:vartype large_face_list: azure.cognitiveservices.vision.face.operations.LargeFaceListOperations

:param endpoint: Supported Cognitive Services endpoints (protocol and
hostname, for example: https://westus.api.cognitive.microsoft.com).
Expand Down Expand Up @@ -91,3 +100,9 @@ def __init__(
self._client, self.config, self._serialize, self._deserialize)
self.face_list = FaceListOperations(
self._client, self.config, self._serialize, self._deserialize)
self.large_person_group_person = LargePersonGroupPersonOperations(
self._client, self.config, self._serialize, self._deserialize)
self.large_person_group = LargePersonGroupOperations(
self._client, self.config, self._serialize, self._deserialize)
self.large_face_list = LargeFaceListOperations(
self._client, self.config, self._serialize, self._deserialize)
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@
from .face_list_py3 import FaceList
from .person_group_py3 import PersonGroup
from .person_py3 import Person
from .update_person_face_request_py3 import UpdatePersonFaceRequest
from .large_face_list_py3 import LargeFaceList
from .large_person_group_py3 import LargePersonGroup
from .update_face_request_py3 import UpdateFaceRequest
from .training_status_py3 import TrainingStatus
from .name_and_user_data_contract_py3 import NameAndUserDataContract
from .image_url_py3 import ImageUrl
Expand Down Expand Up @@ -79,7 +81,9 @@
from .face_list import FaceList
from .person_group import PersonGroup
from .person import Person
from .update_person_face_request import UpdatePersonFaceRequest
from .large_face_list import LargeFaceList
from .large_person_group import LargePersonGroup
from .update_face_request import UpdateFaceRequest
from .training_status import TrainingStatus
from .name_and_user_data_contract import NameAndUserDataContract
from .image_url import ImageUrl
Expand Down Expand Up @@ -129,7 +133,9 @@
'FaceList',
'PersonGroup',
'Person',
'UpdatePersonFaceRequest',
'LargeFaceList',
'LargePersonGroup',
'UpdateFaceRequest',
'TrainingStatus',
'NameAndUserDataContract',
'ImageUrl',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,19 @@ class FindSimilarRequest(Model):
: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
of persistedFaceIds which are persisted and will never expire. Parameter
faceListId and faceIds should not be provided at the same time
faceListId, largeFaceListId and faceIds should not be provided at the same
time。
:type face_list_id: str
:param large_face_list_id: An existing user-specified unique candidate
large face list, created in LargeFaceList - Create. Large face list
contains a set of persistedFaceIds which are persisted and will never
expire. Parameter faceListId, largeFaceListId and faceIds should not 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.
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 .
Expand All @@ -43,13 +51,15 @@ class FindSimilarRequest(Model):
_validation = {
'face_id': {'required': True},
'face_list_id': {'max_length': 64, 'pattern': r'^[a-z0-9-_]+$'},
'large_face_list_id': {'max_length': 64, 'pattern': r'^[a-z0-9-_]+$'},
'face_ids': {'max_items': 1000},
'max_num_of_candidates_returned': {'maximum': 1000, 'minimum': 1},
}

_attribute_map = {
'face_id': {'key': 'faceId', 'type': 'str'},
'face_list_id': {'key': 'faceListId', 'type': 'str'},
'large_face_list_id': {'key': 'largeFaceListId', 'type': 'str'},
'face_ids': {'key': 'faceIds', 'type': '[str]'},
'max_num_of_candidates_returned': {'key': 'maxNumOfCandidatesReturned', 'type': 'int'},
'mode': {'key': 'mode', 'type': 'FindSimilarMatchMode'},
Expand All @@ -59,6 +69,7 @@ def __init__(self, **kwargs):
super(FindSimilarRequest, self).__init__(**kwargs)
self.face_id = kwargs.get('face_id', None)
self.face_list_id = kwargs.get('face_list_id', None)
self.large_face_list_id = kwargs.get('large_face_list_id', None)
self.face_ids = kwargs.get('face_ids', None)
self.max_num_of_candidates_returned = kwargs.get('max_num_of_candidates_returned', 20)
self.mode = kwargs.get('mode', "matchPerson")
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,19 @@ class FindSimilarRequest(Model):
: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
of persistedFaceIds which are persisted and will never expire. Parameter
faceListId and faceIds should not be provided at the same time
faceListId, largeFaceListId and faceIds should not be provided at the same
time。
:type face_list_id: str
:param large_face_list_id: An existing user-specified unique candidate
large face list, created in LargeFaceList - Create. Large face list
contains a set of persistedFaceIds which are persisted and will never
expire. Parameter faceListId, largeFaceListId and faceIds should not 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.
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 .
Expand All @@ -43,22 +51,25 @@ class FindSimilarRequest(Model):
_validation = {
'face_id': {'required': True},
'face_list_id': {'max_length': 64, 'pattern': r'^[a-z0-9-_]+$'},
'large_face_list_id': {'max_length': 64, 'pattern': r'^[a-z0-9-_]+$'},
'face_ids': {'max_items': 1000},
'max_num_of_candidates_returned': {'maximum': 1000, 'minimum': 1},
}

_attribute_map = {
'face_id': {'key': 'faceId', 'type': 'str'},
'face_list_id': {'key': 'faceListId', 'type': 'str'},
'large_face_list_id': {'key': 'largeFaceListId', 'type': 'str'},
'face_ids': {'key': 'faceIds', 'type': '[str]'},
'max_num_of_candidates_returned': {'key': 'maxNumOfCandidatesReturned', 'type': 'int'},
'mode': {'key': 'mode', 'type': 'FindSimilarMatchMode'},
}

def __init__(self, *, face_id: str, face_list_id: str=None, face_ids=None, max_num_of_candidates_returned: int=20, mode="matchPerson", **kwargs) -> None:
def __init__(self, *, face_id: str, face_list_id: str=None, large_face_list_id: str=None, face_ids=None, max_num_of_candidates_returned: int=20, mode="matchPerson", **kwargs) -> None:
super(FindSimilarRequest, self).__init__(**kwargs)
self.face_id = face_id
self.face_list_id = face_list_id
self.large_face_list_id = large_face_list_id
self.face_ids = face_ids
self.max_num_of_candidates_returned = max_num_of_candidates_returned
self.mode = mode
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,19 @@ class IdentifyRequest(Model):

All required parameters must be populated in order to send to Azure.

:param person_group_id: Required. PersonGroupId of the target person
group, created by PersonGroups.Create
:type person_group_id: str
:param face_ids: Required. Array of query faces faceIds, created by the
Face - Detect. Each of the faces are identified independently. The valid
number of faceIds is between [1, 10].
:type face_ids: list[str]
:param person_group_id: PersonGroupId of the target person group, created
by PersonGroup - Create. Parameter personGroupId and largePersonGroupId
should not be provided at the same time.
:type person_group_id: str
:param large_person_group_id: LargePersonGroupId of the target large
person group, created by LargePersonGroup - Create. Parameter
personGroupId and largePersonGroupId should not be provided at the same
time.
:type large_person_group_id: str
:param max_num_of_candidates_returned: The range of
maxNumOfCandidatesReturned is between 1 and 5 (default is 1). Default
value: 1 .
Expand All @@ -35,21 +41,24 @@ class IdentifyRequest(Model):
"""

_validation = {
'person_group_id': {'required': True, 'max_length': 64, 'pattern': r'^[a-z0-9-_]+$'},
'face_ids': {'required': True, 'max_items': 10},
'person_group_id': {'max_length': 64, 'pattern': r'^[a-z0-9-_]+$'},
'large_person_group_id': {'max_length': 64, 'pattern': r'^[a-z0-9-_]+$'},
'max_num_of_candidates_returned': {'maximum': 5, 'minimum': 1},
}

_attribute_map = {
'person_group_id': {'key': 'personGroupId', 'type': 'str'},
'face_ids': {'key': 'faceIds', 'type': '[str]'},
'person_group_id': {'key': 'personGroupId', 'type': 'str'},
'large_person_group_id': {'key': 'largePersonGroupId', 'type': 'str'},
'max_num_of_candidates_returned': {'key': 'maxNumOfCandidatesReturned', 'type': 'int'},
'confidence_threshold': {'key': 'confidenceThreshold', 'type': 'float'},
}

def __init__(self, **kwargs):
super(IdentifyRequest, self).__init__(**kwargs)
self.person_group_id = kwargs.get('person_group_id', None)
self.face_ids = kwargs.get('face_ids', None)
self.person_group_id = kwargs.get('person_group_id', None)
self.large_person_group_id = kwargs.get('large_person_group_id', None)
self.max_num_of_candidates_returned = kwargs.get('max_num_of_candidates_returned', 1)
self.confidence_threshold = kwargs.get('confidence_threshold', None)
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,19 @@ class IdentifyRequest(Model):

All required parameters must be populated in order to send to Azure.

:param person_group_id: Required. PersonGroupId of the target person
group, created by PersonGroups.Create
:type person_group_id: str
:param face_ids: Required. Array of query faces faceIds, created by the
Face - Detect. Each of the faces are identified independently. The valid
number of faceIds is between [1, 10].
:type face_ids: list[str]
:param person_group_id: PersonGroupId of the target person group, created
by PersonGroup - Create. Parameter personGroupId and largePersonGroupId
should not be provided at the same time.
:type person_group_id: str
:param large_person_group_id: LargePersonGroupId of the target large
person group, created by LargePersonGroup - Create. Parameter
personGroupId and largePersonGroupId should not be provided at the same
time.
:type large_person_group_id: str
:param max_num_of_candidates_returned: The range of
maxNumOfCandidatesReturned is between 1 and 5 (default is 1). Default
value: 1 .
Expand All @@ -35,21 +41,24 @@ class IdentifyRequest(Model):
"""

_validation = {
'person_group_id': {'required': True, 'max_length': 64, 'pattern': r'^[a-z0-9-_]+$'},
'face_ids': {'required': True, 'max_items': 10},
'person_group_id': {'max_length': 64, 'pattern': r'^[a-z0-9-_]+$'},
'large_person_group_id': {'max_length': 64, 'pattern': r'^[a-z0-9-_]+$'},
'max_num_of_candidates_returned': {'maximum': 5, 'minimum': 1},
}

_attribute_map = {
'person_group_id': {'key': 'personGroupId', 'type': 'str'},
'face_ids': {'key': 'faceIds', 'type': '[str]'},
'person_group_id': {'key': 'personGroupId', 'type': 'str'},
'large_person_group_id': {'key': 'largePersonGroupId', 'type': 'str'},
'max_num_of_candidates_returned': {'key': 'maxNumOfCandidatesReturned', 'type': 'int'},
'confidence_threshold': {'key': 'confidenceThreshold', 'type': 'float'},
}

def __init__(self, *, person_group_id: str, face_ids, max_num_of_candidates_returned: int=1, confidence_threshold: float=None, **kwargs) -> None:
def __init__(self, *, face_ids, person_group_id: str=None, large_person_group_id: str=None, max_num_of_candidates_returned: int=1, confidence_threshold: float=None, **kwargs) -> None:
super(IdentifyRequest, self).__init__(**kwargs)
self.person_group_id = person_group_id
self.face_ids = face_ids
self.person_group_id = person_group_id
self.large_person_group_id = large_person_group_id
self.max_num_of_candidates_returned = max_num_of_candidates_returned
self.confidence_threshold = confidence_threshold
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from .name_and_user_data_contract import NameAndUserDataContract


class LargeFaceList(NameAndUserDataContract):
"""Large face list object.

All required parameters must be populated in order to send to Azure.

:param name: User defined name, maximum length is 128.
:type name: str
:param user_data: User specified data. Length should not exceed 16KB.
:type user_data: str
:param large_face_list_id: Required. LargeFaceListId of the target large
face list.
:type large_face_list_id: str
"""

_validation = {
'name': {'max_length': 128},
'user_data': {'max_length': 16384},
'large_face_list_id': {'required': True, 'max_length': 64, 'pattern': r'^[a-z0-9-_]+$'},
}

_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'user_data': {'key': 'userData', 'type': 'str'},
'large_face_list_id': {'key': 'largeFaceListId', 'type': 'str'},
}

def __init__(self, **kwargs):
super(LargeFaceList, self).__init__(**kwargs)
self.large_face_list_id = kwargs.get('large_face_list_id', None)
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from .name_and_user_data_contract_py3 import NameAndUserDataContract


class LargeFaceList(NameAndUserDataContract):
"""Large face list object.

All required parameters must be populated in order to send to Azure.

:param name: User defined name, maximum length is 128.
:type name: str
:param user_data: User specified data. Length should not exceed 16KB.
:type user_data: str
:param large_face_list_id: Required. LargeFaceListId of the target large
face list.
:type large_face_list_id: str
"""

_validation = {
'name': {'max_length': 128},
'user_data': {'max_length': 16384},
'large_face_list_id': {'required': True, 'max_length': 64, 'pattern': r'^[a-z0-9-_]+$'},
}

_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'user_data': {'key': 'userData', 'type': 'str'},
'large_face_list_id': {'key': 'largeFaceListId', 'type': 'str'},
}

def __init__(self, *, large_face_list_id: str, name: str=None, user_data: str=None, **kwargs) -> None:
super(LargeFaceList, self).__init__(name=name, user_data=user_data, **kwargs)
self.large_face_list_id = large_face_list_id
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from .name_and_user_data_contract import NameAndUserDataContract


class LargePersonGroup(NameAndUserDataContract):
"""Large person group object.

All required parameters must be populated in order to send to Azure.

:param name: User defined name, maximum length is 128.
:type name: str
:param user_data: User specified data. Length should not exceed 16KB.
:type user_data: str
:param large_person_group_id: Required. LargePersonGroupId of the target
large person groups
:type large_person_group_id: str
"""

_validation = {
'name': {'max_length': 128},
'user_data': {'max_length': 16384},
'large_person_group_id': {'required': True, 'max_length': 64, 'pattern': r'^[a-z0-9-_]+$'},
}

_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'user_data': {'key': 'userData', 'type': 'str'},
'large_person_group_id': {'key': 'largePersonGroupId', 'type': 'str'},
}

def __init__(self, **kwargs):
super(LargePersonGroup, self).__init__(**kwargs)
self.large_person_group_id = kwargs.get('large_person_group_id', None)
Loading