Skip to content

Commit

Permalink
Update Face spec for initial release (#29161)
Browse files Browse the repository at this point in the history
* Refine detection

* Remove stateful operation for first release

* Update detect03 description

* Update quality for reco description

* Add access and remove usage

* Revert java change

* Keep convenience methods for java

This reverts commit cf7dfc4.
  • Loading branch information
Han-msft committed May 22, 2024
1 parent e877b8a commit 1d2253d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 118 deletions.
118 changes: 6 additions & 112 deletions specification/ai/Face/client.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,16 @@ namespace ClientCustomizations;

@@clientName(RecognitionModel, "FaceRecognitionModel");
@@clientName(DetectionModel, "FaceDetectionModel");
@@clientName(OperationStatus, "FaceOperationStatus");
@@clientName(TrainingResult, "FaceCollectionTrainingResult");
@@clientName(IdentificationResult, "FaceIdentificationResult");
@@clientName(IdentificationCandidate, "FaceIdentificationCandidate");
@@clientName(VerificationResult, "FaceVerificationResult");
@@clientName(FindSimilarResult, "FaceFindSimilarResult");
@@clientName(GroupingResult, "FaceGroupingResult");
@@clientName(OperationResult, "FaceOperationResult");
@@clientName(LivenessDecision, "FaceLivenessDecision");
@@clientName(ImageType, "FaceImageType");

@@access(DetectionModel, Access.public);
@@access(RecognitionModel, Access.public);
@@access(FaceAttributeType, Access.public);
@@usage(FaceAttributeType, Usage.input, "java");
@@access(FaceDetectionResult, Access.public);
@@usage(FaceDetectionResult, Usage.output, "java");
@@access(FaceLandmarks, Access.public);
@@access(LandmarkCoordinate, Access.public);
@@access(FaceAttributes, Access.public);
Expand Down Expand Up @@ -57,121 +52,20 @@ namespace ClientCustomizations;
})
interface FaceClient {
@access(Access.internal)
@convenientAPI(false, "java")
@convenientAPI(false, "csharp")
@clientName("detectFromUrlImpl", "java")
@clientName("detectFromUrlImpl", "csharp")
detectFromUrl is FaceDetectionOperations.detectFromUrl;
#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)
@convenientAPI(false, "java")
@convenientAPI(false, "csharp")
@clientName("detectImpl", "java")
@clientName("detectImpl", "csharp")
detect is FaceDetectionOperations.detect;

findSimilar is FaceRecognitionOperations.findSimilar;
findSimilarFromFaceList is FaceRecognitionOperations.findSimilarFromFaceList;
findSimilarFromLargeFaceList is FaceRecognitionOperations.findSimilarFromLargeFaceList;
identifyFromPersonGroup is FaceRecognitionOperations.identifyFromPersonGroup;
identifyFromLargePersonGroup is FaceRecognitionOperations.identifyFromLargePersonGroup;
identifyFromPersonDirectory is FaceRecognitionOperations.identifyFromPersonDirectory;
identifyFromDynamicPersonGroup is FaceRecognitionOperations.identifyFromDynamicPersonGroup;
verifyFaceToFace is FaceRecognitionOperations.verifyFaceToFace;
verifyFromPersonGroup is FaceRecognitionOperations.verifyFromPersonGroup;
verifyFromLargePersonGroup is FaceRecognitionOperations.verifyFromLargePersonGroup;
verifyFromPersonDirectory is FaceRecognitionOperations.verifyFromPersonDirectory;
group is FaceRecognitionOperations.group;
}

@client({
name: "FaceAdministrationClient",
service: Face,
})
interface FaceAdministrationClient {
createFaceList is FaceListOperations.createFaceList;
deleteFaceList is FaceListOperations.deleteFaceList;
getFaceList is FaceListOperations.getFaceList;
updateFaceList is FaceListOperations.updateFaceList;
getFaceLists is FaceListOperations.getFaceLists;
addFaceListFaceFromUrl is FaceListOperations.addFaceListFaceFromUrl;
#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."
addFaceListFace is FaceListOperations.addFaceListFace;
deleteFaceListFace is FaceListOperations.deleteFaceListFace;

createLargeFaceList is FaceListOperations.createLargeFaceList;
deleteLargeFaceList is FaceListOperations.deleteLargeFaceList;
getLargeFaceList is FaceListOperations.getLargeFaceList;
updateLargeFaceList is FaceListOperations.updateLargeFaceList;
getLargeFaceLists is FaceListOperations.getLargeFaceLists;
getLargeFaceListTrainingStatus is FaceListOperations.getLargeFaceListTrainingStatus;
trainLargeFaceList is FaceListOperations.trainLargeFaceList;
addLargeFaceListFaceFromUrl is FaceListOperations.addLargeFaceListFaceFromUrl;
#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."
addLargeFaceListFace is FaceListOperations.addLargeFaceListFace;
deleteLargeFaceListFace is FaceListOperations.deleteLargeFaceListFace;
getLargeFaceListFace is FaceListOperations.getLargeFaceListFace;
updateLargeFaceListFace is FaceListOperations.updateLargeFaceListFace;
getLargeFaceListFaces is FaceListOperations.getLargeFaceListFaces;

createPersonGroup is PersonGroupOperations.createPersonGroup;
deletePersonGroup is PersonGroupOperations.deletePersonGroup;
getPersonGroup is PersonGroupOperations.getPersonGroup;
updatePersonGroup is PersonGroupOperations.updatePersonGroup;
getPersonGroups is PersonGroupOperations.getPersonGroups;
getPersonGroupTrainingStatus is PersonGroupOperations.getPersonGroupTrainingStatus;
trainPersonGroup is PersonGroupOperations.trainPersonGroup;
createPersonGroupPerson is PersonGroupOperations.createPersonGroupPerson;
deletePersonGroupPerson is PersonGroupOperations.deletePersonGroupPerson;
getPersonGroupPerson is PersonGroupOperations.getPersonGroupPerson;
updatePersonGroupPerson is PersonGroupOperations.updatePersonGroupPerson;
getPersonGroupPersons is PersonGroupOperations.getPersonGroupPersons;
addPersonGroupPersonFaceFromUrl is PersonGroupOperations.addPersonGroupPersonFaceFromUrl;
#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."
addPersonGroupPersonFace is PersonGroupOperations.addPersonGroupPersonFace;
deletePersonGroupPersonFace is PersonGroupOperations.deletePersonGroupPersonFace;
getPersonGroupPersonFace is PersonGroupOperations.getPersonGroupPersonFace;
updatePersonGroupPersonFace is PersonGroupOperations.updatePersonGroupPersonFace;

createLargePersonGroup is PersonGroupOperations.createLargePersonGroup;
deleteLargePersonGroup is PersonGroupOperations.deleteLargePersonGroup;
getLargePersonGroup is PersonGroupOperations.getLargePersonGroup;
updateLargePersonGroup is PersonGroupOperations.updateLargePersonGroup;
getLargePersonGroups is PersonGroupOperations.getLargePersonGroups;
getLargePersonGroupTrainingStatus is PersonGroupOperations.getLargePersonGroupTrainingStatus;
trainLargePersonGroup is PersonGroupOperations.trainLargePersonGroup;
createLargePersonGroupPerson is PersonGroupOperations.createLargePersonGroupPerson;
deleteLargePersonGroupPerson is PersonGroupOperations.deleteLargePersonGroupPerson;
getLargePersonGroupPerson is PersonGroupOperations.getLargePersonGroupPerson;
updateLargePersonGroupPerson is PersonGroupOperations.updateLargePersonGroupPerson;
getLargePersonGroupPersons is PersonGroupOperations.getLargePersonGroupPersons;
addLargePersonGroupPersonFaceFromUrl is PersonGroupOperations.addLargePersonGroupPersonFaceFromUrl;
#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."
addLargePersonGroupPersonFace is PersonGroupOperations.addLargePersonGroupPersonFace;
deleteLargePersonGroupPersonFace is PersonGroupOperations.deleteLargePersonGroupPersonFace;
getLargePersonGroupPersonFace is PersonGroupOperations.getLargePersonGroupPersonFace;
updateLargePersonGroupPersonFace is PersonGroupOperations.updateLargePersonGroupPersonFace;

createPerson is PersonDirectoryOperations.createPerson;
deletePerson is PersonDirectoryOperations.deletePerson;
getPerson is PersonDirectoryOperations.getPerson;
updatePerson is PersonDirectoryOperations.updatePerson;
getPersons is PersonDirectoryOperations.getPersons;
getDynamicPersonGroupReferences is PersonDirectoryOperations.getDynamicPersonGroupReferences;
addPersonFaceFromUrl is PersonDirectoryOperations.addPersonFaceFromUrl;
#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."
addPersonFace is PersonDirectoryOperations.addPersonFace;
deletePersonFace is PersonDirectoryOperations.deletePersonFace;
getPersonFace is PersonDirectoryOperations.getPersonFace;
updatePersonFace is PersonDirectoryOperations.updatePersonFace;
getPersonFaces is PersonDirectoryOperations.getPersonFaces;

createDynamicPersonGroupWithPerson is PersonDirectoryOperations.createDynamicPersonGroupWithPerson;
createDynamicPersonGroup is PersonDirectoryOperations.createDynamicPersonGroup;
deleteDynamicPersonGroup is PersonDirectoryOperations.deleteDynamicPersonGroup;
getDynamicPersonGroup is PersonDirectoryOperations.getDynamicPersonGroup;
updateDynamicPersonGroupWithPersonChanges is PersonDirectoryOperations.updateDynamicPersonGroupWithPersonChanges;
updateDynamicPersonGroup is PersonDirectoryOperations.updateDynamicPersonGroup;
getDynamicPersonGroups is PersonDirectoryOperations.getDynamicPersonGroups;
getDynamicPersonGroupPersons is PersonDirectoryOperations.getDynamicPersonGroupPersons;
}

@client({
name: "FaceSessionClient",
service: Face,
Expand Down
2 changes: 1 addition & 1 deletion specification/ai/Face/models.detect.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ union FaceAttributeType {
@doc("Whether each face is wearing a mask. Mask type returns 'noMask', 'faceMask', 'otherMaskOrOcclusion', or 'uncertain'. Value returns a boolean 'noseAndMouthCovered' indicating whether nose and mouth are covered.")
"mask",

@doc("The overall image quality regarding whether the image being used in the detection is of sufficient quality to attempt face recognition on. The value is an informal rating of low, medium, or high. Only 'high' quality images are recommended for person enrollment and quality at or above 'medium' is recommended for identification scenarios. The attribute is only available when using any combinations of detection models detection_01 or detection_03, and recognition models recognition_03 or recognition_04.")
@doc("The overall image quality regarding whether the image being used in the detection is of sufficient quality to attempt face recognition on. The value is an informal rating of low, medium, or high. Only 'high' quality images are recommended for person enrollment and quality at or above 'medium' is recommended for identification scenarios. The attribute is only available when using recognition models recognition_03 or recognition_04.")
"qualityForRecognition",

@doc("Age in years.")
Expand Down
2 changes: 1 addition & 1 deletion specification/ai/Face/routes.detection.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace Face;
* For optimal results when querying \"Identify\", \"Verify\", and \"Find Similar\" ('returnFaceId' is true), please use faces that are: frontal, clear, and with a minimum size of 200x200 pixels (100 pixels between eyes).
* Different 'detectionModel' values can be provided. To use and compare different detection models, please refer to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model
* 'detection_02': Face attributes and landmarks are disabled if you choose this detection model.
* 'detection_03': Face attributes (mask and headPose only) and landmarks are supported if you choose this detection model.
* 'detection_03': Face attributes (mask, blur, and headPose) and landmarks are supported if you choose this 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 https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-recognition-model.
""")
@returnsDoc("A successful call returns an array of face entries ranked by face rectangle size in descending order. An empty response indicates no faces detected.")
Expand Down
Loading

0 comments on commit 1d2253d

Please sign in to comment.