I'm trying to experiment with the Face API cognitive service provided by Azure. I'm using the following C# code .
public static IFaceClient Authenticate(string endpoint, string key)
{
return new FaceClient(new ApiKeyServiceClientCredentials(key)) { Endpoint = endpoint };
}
IFaceClient client = Authenticate("my endpoint", "mykey");
IList<DetectedFace> detectedFaces = client.Face.DetectWithUrlAsync("https://csdx.blob.core.windows.net/resources/Face/Images/", recognitionModel: RecognitionModel.Recognition04, detectionModel: DetectionModel.Detection03, returnFaceAttributes: new List<FaceAttributeType> { FaceAttributeType.QualityForRecognition }).Result;
But I keep getting the following exception
InnerException{Microsoft.Azure.CognitiveServices.Vision.Face.Models.APIErrorException: Operation returned an invalid status code 'Forbidden'
Is the use of Face detection restricted ? Do I need to request any special rights for the same?
CodePudding user response:
To resolve InnerException{Microsoft.Azure.CognitiveServices.Vision.Face.Models.APIErrorException: Operation returned an invalid status code 'Forbidden'
error:
According to Responsible AI investments and safeguards for facial recognition and Call the Detect API:
To mitigate these risks, we have opted to not support a general-purpose system in the Face API that purports to infer emotional states, gender, age, smile, facial hair, hair, and makeup. Detection of these attributes will no longer be available to new customers beginning June 21, 2022, and existing customers have until June 30, 2023, to discontinue use of these attributes before they are retired.
Face service access is limited based on eligibility and usage criteria in order to support our Responsible AI principles. Face service is only available to Microsoft managed customers and partners.
You can submit the Face Recognition intake form to apply for the access.