Skip to content

Commit

Permalink
Update Face spec (#29120)
Browse files Browse the repository at this point in the history
* Rename url as uri for cs

* Add PassiveActive for liveness

* Update OAS
  • Loading branch information
Han-msft authored May 17, 2024
1 parent 6ac5a67 commit 60161e2
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 5 deletions.
7 changes: 5 additions & 2 deletions specification/ai/Face/models.session.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@ using TypeSpec.Rest;

namespace Face;

@doc("The operation mode for the liveness modal.")
@doc("The liveness operation mode to drive the client’s end-user experience.")
union LivenessOperationMode {
string,

@doc("The operation mode for the liveness modal.")
@doc("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",

@doc("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.")
"PassiveActive",
}

#suppress "@azure-tools/typespec-autorest/unsupported-multipart-type" "Provide convenient interface for multipart/form-data in SDK"
Expand Down
3 changes: 3 additions & 0 deletions specification/ai/Face/routes.common.tsp
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import "@typespec/http";
import "@typespec/rest";
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-client-generator-core";
import "./models.common.tsp";
import "./models.detect.tsp";

using TypeSpec.Http;
using TypeSpec.Rest;
using Azure.ClientGenerator.Core;
using Azure.Core;
using Azure.Core.Traits;
using Foundations;
Expand Down Expand Up @@ -66,6 +68,7 @@ op AddFace<TFace extends BaseFace> is Foundations.ResourceCollectionOperation<
op AddFaceFromUrl<TFace extends BaseFace> is Foundations.ResourceCollectionOperation<
TFace,
AddFaceOptions & {
@clientName("uri", "csharp")
@doc("URL of input image.")
url: url;
},
Expand Down
2 changes: 2 additions & 0 deletions specification/ai/Face/routes.detection.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import "./models.detect.tsp";

using TypeSpec.Http;
using TypeSpec.Rest;
using Azure.ClientGenerator.Core;
using Azure.Core;
using Azure.Core.Traits;
using Foundations;
Expand Down Expand Up @@ -46,6 +47,7 @@ interface FaceDetectionOperations {
@header
contentType: "application/json";

@clientName("uri", "csharp")
@doc("URL of input image.")
url: url;
}>;
Expand Down
2 changes: 2 additions & 0 deletions specification/ai/Face/routes.persondirectory.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import "./models.persondirectory.tsp";

using TypeSpec.Http;
using TypeSpec.Rest;
using Azure.ClientGenerator.Core;
using Azure.Core;
using Azure.Core.Traits;
using Foundations;
Expand Down Expand Up @@ -182,6 +183,7 @@ interface PersonDirectoryOperations {
#suppress "@azure-tools/typespec-azure-core/byos" "It's an RPC call to detect face from an image, it doesn't store anything. There's a BYOS version of this call, but it's not this one."
#suppress "@azure-tools/typespec-azure-core/long-running-polling-operation-required" "Doesn't fit in generated long-running operation"
addPersonFaceFromUrl is AddPersonFaceOperation<{
@clientName("uri", "csharp")
@doc("URL of input image.")
url: url;
}>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8627,9 +8627,10 @@
},
"LivenessOperationMode": {
"type": "string",
"description": "The operation mode for the liveness modal.",
"description": "The liveness operation mode to drive the client’s end-user experience.",
"enum": [
"Passive"
"Passive",
"PassiveActive"
],
"x-ms-enum": {
"name": "LivenessOperationMode",
Expand All @@ -8638,7 +8639,12 @@
{
"name": "Passive",
"value": "Passive",
"description": "The operation mode for the liveness modal."
"description": "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."
},
{
"name": "PassiveActive",
"value": "PassiveActive",
"description": "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."
}
]
}
Expand Down

0 comments on commit 60161e2

Please sign in to comment.