Skip to content

Commit

Permalink
Add AI Face next GA version (#31023)
Browse files Browse the repository at this point in the history
* Add face v1.2

* Correct find similar example response

* Update liveness example
  • Loading branch information
Han-msft authored Jan 18, 2025
1 parent de825aa commit 24d856b
Show file tree
Hide file tree
Showing 175 changed files with 11,689 additions and 92 deletions.
19 changes: 2 additions & 17 deletions specification/ai/Face/client.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ using Azure.ClientGenerator.Core;
using Face;

@TypeSpec.Versioning.useDependency(Azure.Core.Versions.v1_0_Preview_2)
@TypeSpec.Versioning.useDependency(Face.Versions.v1_2_preview_1)
@TypeSpec.Versioning.useDependency(Face.Versions.v1_2)
namespace ClientCustomizations;

@@clientName(RecognitionModel, "FaceRecognitionModel");
Expand All @@ -22,9 +22,6 @@ namespace ClientCustomizations;
@@clientName(TrainingResult, "FaceTrainingResult");
@@clientName(IdentificationCandidate, "FaceIdentificationCandidate");
@@clientName(IdentificationResult, "FaceIdentificationResult");
@@clientName(CreateLivenessWithVerifySessionJsonContent,
"CreateLivenessWithVerifySessionContent"
);

@@access(DetectionModel, Access.public);
@@access(RecognitionModel, Access.public);
Expand Down Expand Up @@ -216,26 +213,14 @@ interface FaceSessionClient {
deleteLivenessSession is LivenessSessionOperations.deleteLivenessSession;
@doc("Please refer to https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-session-result for more details.")
getLivenessSessionResult is LivenessSessionOperations.getLivenessSessionResult;
@doc("Please refer to https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-sessions for more details.")
getLivenessSessions is LivenessSessionOperations.getLivenessSessions;
@doc("Please refer to https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-session-audit-entries for more details.")
getLivenessSessionAuditEntries is LivenessSessionOperations.getLivenessSessionAuditEntries;

@access(Access.internal)
@doc("Please refer to https://learn.microsoft.com/rest/api/face/liveness-session-operations/create-liveness-with-verify-session for more details.")
createLivenessWithVerifySession is LivenessSessionOperations.createLivenessWithVerifySession;
#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."
@access(Access.internal)
@doc("Please refer to https://learn.microsoft.com/rest/api/face/liveness-session-operations/create-liveness-with-verify-session-with-verify-image for more details.")
createLivenessWithVerifySessionWithVerifyImage is LivenessSessionOperations.createLivenessWithVerifySessionWithVerifyImage;
createLivenessWithVerifySession is LivenessSessionOperations.createLivenessWithVerifySession;
@doc("Please refer to https://learn.microsoft.com/rest/api/face/liveness-session-operations/delete-liveness-with-verify-session for more details.")
deleteLivenessWithVerifySession is LivenessSessionOperations.deleteLivenessWithVerifySession;
@doc("Please refer to https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-with-verify-session-result for more details.")
getLivenessWithVerifySessionResult is LivenessSessionOperations.getLivenessWithVerifySessionResult;
@doc("Please refer to https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-with-verify-sessions for more details.")
getLivenessWithVerifySessions is LivenessSessionOperations.getLivenessWithVerifySessions;
@doc("Please refer to https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-with-verify-session-audit-entries for more details.")
getLivenessWithVerifySessionAuditEntries is LivenessSessionOperations.getLivenessWithVerifySessionAuditEntries;

@doc("Please refer to https://learn.microsoft.com/rest/api/face/face-detection-operations/detect-from-session-image-id for more details.")
detectFromSessionImage is FaceDetectionOperations.detectFromSessionImageId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"body": {
"livenessOperationMode": "Passive",
"sendResultsToClient": true,
"deviceCorrelationIdSetInClient": true,
"deviceCorrelationIdSetInClient": false,
"deviceCorrelationId": "your_device_correlation_id",
"authTokenTimeToLiveInSeconds": 60
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"body": {
"livenessOperationMode": "Passive",
"sendResultsToClient": true,
"deviceCorrelationIdSetInClient": true,
"deviceCorrelationIdSetInClient": false,
"deviceCorrelationId": "your_device_correlation_id",
"authTokenTimeToLiveInSeconds": 60
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"operationId": "LivenessSessionOperations_CreateLivenessWithVerifySessionWithVerifyImage",
"parameters": {
"apiVersion": "v1.1-preview.1",
"Parameters": "{\"livenessOperationMode\": \"Passive\", \"sendResultsToClient\": true, \"deviceCorrelationIdSetInClient\": true, \"deviceCorrelationId\": \"your_device_correlation_id\", \"authTokenTimeToLiveInSeconds\": 60}",
"Parameters": "{\"livenessOperationMode\": \"Passive\", \"sendResultsToClient\": true, \"deviceCorrelationIdSetInClient\": false, \"deviceCorrelationId\": \"your_device_correlation_id\", \"authTokenTimeToLiveInSeconds\": 60}",
"VerifyImage": "<your-image-bytes-here>"
},
"responses": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"body": {
"livenessOperationMode": "Passive",
"sendResultsToClient": true,
"deviceCorrelationIdSetInClient": true,
"deviceCorrelationIdSetInClient": false,
"deviceCorrelationId": "your_device_correlation_id",
"authTokenTimeToLiveInSeconds": 60
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"body": {
"livenessOperationMode": "Passive",
"sendResultsToClient": true,
"deviceCorrelationIdSetInClient": true,
"deviceCorrelationIdSetInClient": false,
"deviceCorrelationId": "your_device_correlation_id",
"authTokenTimeToLiveInSeconds": 60
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"operationId": "LivenessSessionOperations_CreateLivenessWithVerifySessionWithVerifyImage",
"parameters": {
"apiVersion": "v1.2-preview.1",
"Parameters": "{\"livenessOperationMode\": \"Passive\", \"sendResultsToClient\": true, \"deviceCorrelationIdSetInClient\": true, \"deviceCorrelationId\": \"your_device_correlation_id\", \"authTokenTimeToLiveInSeconds\": 60}",
"Parameters": "{\"livenessOperationMode\": \"Passive\", \"sendResultsToClient\": true, \"deviceCorrelationIdSetInClient\": false, \"deviceCorrelationId\": \"your_device_correlation_id\", \"authTokenTimeToLiveInSeconds\": 60}",
"VerifyImage": "<your-image-bytes-here>"
},
"responses": {
Expand Down
181 changes: 181 additions & 0 deletions specification/ai/Face/examples/v1.2/Detect.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
{
"title": "Detect with Image",
"operationId": "FaceDetectionOperations_Detect",
"parameters": {
"apiVersion": "v1.2",
"returnFaceId": true,
"returnFaceLandmarks": true,
"returnFaceAttributes": "glasses,headPose,occlusion,accessories,blur,exposure,noise,qualityForRecognition",
"recognitionModel": "recognition_03",
"returnRecognitionModel": true,
"detectionModel": "detection_01",
"faceIdTimeToLive": 60,
"imageContent": "<your-image-bytes-here>"
},
"responses": {
"200": {
"body": [
{
"faceId": "c5c24a82-6845-4031-9d5d-978df9175426",
"recognitionModel": "recognition_03",
"faceRectangle": {
"width": 78,
"height": 78,
"left": 394,
"top": 54
},
"faceLandmarks": {
"pupilLeft": {
"x": 412.7,
"y": 78.4
},
"pupilRight": {
"x": 446.8,
"y": 74.2
},
"noseTip": {
"x": 437.7,
"y": 92.4
},
"mouthLeft": {
"x": 417.8,
"y": 114.4
},
"mouthRight": {
"x": 451.3,
"y": 109.3
},
"eyebrowLeftOuter": {
"x": 397.9,
"y": 78.5
},
"eyebrowLeftInner": {
"x": 425.4,
"y": 70.5
},
"eyeLeftOuter": {
"x": 406.7,
"y": 80.6
},
"eyeLeftTop": {
"x": 412.2,
"y": 76.2
},
"eyeLeftBottom": {
"x": 413.0,
"y": 80.1
},
"eyeLeftInner": {
"x": 418.9,
"y": 78.0
},
"eyebrowRightInner": {
"x": 4.8,
"y": 69.7
},
"eyebrowRightOuter": {
"x": 5.5,
"y": 68.5
},
"eyeRightInner": {
"x": 441.5,
"y": 75.0
},
"eyeRightTop": {
"x": 446.4,
"y": 71.7
},
"eyeRightBottom": {
"x": 447.0,
"y": 75.3
},
"eyeRightOuter": {
"x": 451.7,
"y": 73.4
},
"noseRootLeft": {
"x": 428.0,
"y": 77.1
},
"noseRootRight": {
"x": 435.8,
"y": 75.6
},
"noseLeftAlarTop": {
"x": 428.3,
"y": 89.7
},
"noseRightAlarTop": {
"x": 442.2,
"y": 87.0
},
"noseLeftAlarOutTip": {
"x": 424.3,
"y": 96.4
},
"noseRightAlarOutTip": {
"x": 446.6,
"y": 92.5
},
"upperLipTop": {
"x": 437.6,
"y": 105.9
},
"upperLipBottom": {
"x": 437.6,
"y": 108.2
},
"underLipTop": {
"x": 436.8,
"y": 111.4
},
"underLipBottom": {
"x": 437.3,
"y": 114.5
}
},
"faceAttributes": {
"glasses": "sunglasses",
"headPose": {
"roll": 2.1,
"yaw": 3,
"pitch": 1.6
},
"occlusion": {
"foreheadOccluded": false,
"eyeOccluded": false,
"mouthOccluded": false
},
"accessories": [
{
"type": "headwear",
"confidence": 0.99
},
{
"type": "glasses",
"confidence": 1.0
},
{
"type": "mask",
"confidence": 0.87
}
],
"blur": {
"blurLevel": "medium",
"value": 0.51
},
"exposure": {
"exposureLevel": "goodExposure",
"value": 0.55
},
"noise": {
"noiseLevel": "low",
"value": 0.12
},
"qualityForRecognition": "high"
}
}
]
}
}
}
Loading

0 comments on commit 24d856b

Please sign in to comment.