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

Update Face SDK #7173

Closed
wants to merge 2 commits into from
Closed
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 @@ -18860,7 +18860,7 @@ def create_liveness_session(
# JSON input template you can fill out and use as your body input.
body = {
"livenessOperationMode": "str", # Type of liveness mode the client should
follow. Required. "Passive"
follow. Required. Known values are: "Passive" and "PassiveActive".
"authTokenTimeToLiveInSeconds": 0, # Optional. Seconds the session should
last for. Range is 60 to 86400 seconds. Default value is 600.
"deviceCorrelationId": "str", # Optional. Unique Guid per each end-user
Expand Down Expand Up @@ -19034,7 +19034,7 @@ def create_liveness_session(
# JSON input template you can fill out and use as your body input.
body = {
"livenessOperationMode": "str", # Type of liveness mode the client should
follow. Required. "Passive"
follow. Required. Known values are: "Passive" and "PassiveActive".
"authTokenTimeToLiveInSeconds": 0, # Optional. Seconds the session should
last for. Range is 60 to 86400 seconds. Default value is 600.
"deviceCorrelationId": "str", # Optional. Unique Guid per each end-user
Expand Down Expand Up @@ -19687,7 +19687,7 @@ def _create_liveness_with_verify_session(
# JSON input template you can fill out and use as your body input.
body = {
"livenessOperationMode": "str", # Type of liveness mode the client should
follow. Required. "Passive"
follow. Required. Known values are: "Passive" and "PassiveActive".
"authTokenTimeToLiveInSeconds": 0, # Optional. Seconds the session should
last for. Range is 60 to 86400 seconds. Default value is 600.
"deviceCorrelationId": "str", # Optional. Unique Guid per each end-user
Expand Down Expand Up @@ -19845,7 +19845,7 @@ def _create_liveness_with_verify_session_with_verify_image( # pylint: disable=n
body = {
"Parameters": {
"livenessOperationMode": "str", # Type of liveness mode the client
should follow. Required. "Passive"
should follow. Required. Known values are: "Passive" and "PassiveActive".
"authTokenTimeToLiveInSeconds": 0, # Optional. Seconds the session
should last for. Range is 60 to 86400 seconds. Default value is 600.
"deviceCorrelationId": "str", # Optional. Unique Guid per each
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16493,7 +16493,7 @@ async def create_liveness_session(
# JSON input template you can fill out and use as your body input.
body = {
"livenessOperationMode": "str", # Type of liveness mode the client should
follow. Required. "Passive"
follow. Required. Known values are: "Passive" and "PassiveActive".
"authTokenTimeToLiveInSeconds": 0, # Optional. Seconds the session should
last for. Range is 60 to 86400 seconds. Default value is 600.
"deviceCorrelationId": "str", # Optional. Unique Guid per each end-user
Expand Down Expand Up @@ -16667,7 +16667,7 @@ async def create_liveness_session(
# JSON input template you can fill out and use as your body input.
body = {
"livenessOperationMode": "str", # Type of liveness mode the client should
follow. Required. "Passive"
follow. Required. Known values are: "Passive" and "PassiveActive".
"authTokenTimeToLiveInSeconds": 0, # Optional. Seconds the session should
last for. Range is 60 to 86400 seconds. Default value is 600.
"deviceCorrelationId": "str", # Optional. Unique Guid per each end-user
Expand Down Expand Up @@ -17320,7 +17320,7 @@ async def _create_liveness_with_verify_session(
# JSON input template you can fill out and use as your body input.
body = {
"livenessOperationMode": "str", # Type of liveness mode the client should
follow. Required. "Passive"
follow. Required. Known values are: "Passive" and "PassiveActive".
"authTokenTimeToLiveInSeconds": 0, # Optional. Seconds the session should
last for. Range is 60 to 86400 seconds. Default value is 600.
"deviceCorrelationId": "str", # Optional. Unique Guid per each end-user
Expand Down Expand Up @@ -17478,7 +17478,7 @@ async def _create_liveness_with_verify_session_with_verify_image( # pylint: dis
body = {
"Parameters": {
"livenessOperationMode": "str", # Type of liveness mode the client
should follow. Required. "Passive"
should follow. Required. Known values are: "Passive" and "PassiveActive".
"authTokenTimeToLiveInSeconds": 0, # Optional. Seconds the session
should last for. Range is 60 to 86400 seconds. Default value is 600.
"deviceCorrelationId": "str", # Optional. Unique Guid per each
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,21 @@ class LivenessModel(str, Enum, metaclass=CaseInsensitiveEnumMeta):


class LivenessOperationMode(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The operation mode for the liveness modal."""
"""The liveness operation mode to drive the client’s end-user experience."""

PASSIVE = "Passive"
"""The operation mode for the liveness modal."""
"""Utilizes a passive liveness technique that requires no additional actions from the user.
Requires normal indoor lighting and high screen brightness for optimal performance. And thus,
this mode has a narrow operational envelope and will not be suitable for scenarios that
requires the end-user’s to be in bright lighting conditions. Note: this is the only supported
mode for the Mobile (iOS and Android) solution."""
PASSIVE_ACTIVE = "PassiveActive"
"""This mode utilizes a hybrid passive or active liveness technique that necessitates user
cooperation. It is optimized to require active motion only under suboptimal lighting
conditions. Unlike the passive mode, this mode has no lighting restrictions, and thus offering
a broader operational envelope. This mode is preferable on Web based solutions due to the lack
of automatic screen brightness control available on browsers which hinders the Passive mode’s
operational envelope on Web based solutions."""


class MaskType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,8 @@ class CreateLivenessSessionContent(_model_base.Model):

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

:ivar liveness_operation_mode: Type of liveness mode the client should follow. Required.
"Passive"
:ivar liveness_operation_mode: Type of liveness mode the client should follow. Required. Known
values are: "Passive" and "PassiveActive".
:vartype liveness_operation_mode: str or ~azure.ai.vision.face.models.LivenessOperationMode
:ivar send_results_to_client: Whether or not to allow a '200 - Success' response body to be
sent to the client, which may be undesirable for security reasons. Default is false, clients
Expand All @@ -253,7 +253,8 @@ class CreateLivenessSessionContent(_model_base.Model):
"""

liveness_operation_mode: Union[str, "_models.LivenessOperationMode"] = rest_field(name="livenessOperationMode")
"""Type of liveness mode the client should follow. Required. \"Passive\""""
"""Type of liveness mode the client should follow. Required. Known values are: \"Passive\" and
\"PassiveActive\"."""
send_results_to_client: Optional[bool] = rest_field(name="sendResultsToClient")
"""Whether or not to allow a '200 - Success' response body to be sent to the client, which may be
undesirable for security reasons. Default is false, clients will receive a '204 - NoContent'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class FaceAttributeTypeDetection01(str, Enum, metaclass=CaseInsensitiveEnumMeta)
class FaceAttributeTypeDetection03(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Available attribute options for detection_03 model."""

BLUR = FaceAttributeType.BLUR.value
HEAD_POSE = FaceAttributeType.HEAD_POSE.value
MASK = FaceAttributeType.MASK.value

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def detect(self):
recognition_model=FaceRecognitionModel.RECOGNITION_04,
return_face_id=True,
return_face_attributes=[
FaceAttributeTypeDetection03.BLUR,
FaceAttributeTypeDetection03.HEAD_POSE,
FaceAttributeTypeDetection03.MASK,
FaceAttributeTypeRecognition04.QUALITY_FOR_RECOGNITION,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ async def detect(self):
recognition_model=FaceRecognitionModel.RECOGNITION_04,
return_face_id=True,
return_face_attributes=[
FaceAttributeTypeDetection03.BLUR,
FaceAttributeTypeDetection03.HEAD_POSE,
FaceAttributeTypeDetection03.MASK,
FaceAttributeTypeRecognition04.QUALITY_FOR_RECOGNITION,
Expand Down
2 changes: 1 addition & 1 deletion sdk/face/azure-ai-vision-face/tsp-location.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
directory: specification/ai/Face
commit: 969c68562c5c4850257c9242a7a64b73c15f110d
commit: 60161e2f7d24680d91db0685e1912cfe85ba13d9
repo: Azure/azure-rest-api-specs
additionalDirectories: