I have been trying to use the Azure face service through Python and have copy pasted the code from the official site. (https://learn.microsoft.com/en-us/azure/cognitive-services/computer-vision/quickstarts-sdk/identity-client-library?tabs=visual-studio&pivots=programming-language-python). I have a free student benefits account.
I have updated the key and endpoint and let the image links remain as it is. However, I am getting the following error when I run the code.
Person group: 61ec255a-06db-45dd-ac7e-90c9dfac98b0
Traceback (most recent call last):
File "f:CollegeSEM 6IOTazure codefile.py", line 43, in <module>
face_client.person_group.create(person_group_id=PERSON_GROUP_ID, name=PERSON_GROUP_ID, recognition_model='recognition_04')
File "C:UsershpAppDataLocalProgramsPythonPython39libsite-packagesazurecognitiveservicesvisionfaceoperations_person_group_operations.py", line 121, in create
raise models.APIErrorException(self._deserialize, response)
azure.cognitiveservices.vision.face.models._models_py3.APIErrorException: (InvalidRequest) Invalid request has been sent.
I don’t know where I am going wrong. Can someone please point out what’s happening here?
3
Answers
Verify the below checklist:
Microsoft has limited access to certain features (including the Face API in order to respect their principles of responsible AI) to people who are accredited After filling out their form which you can find on their website.
Like baptistin pointed out, the issue is with the limited access to certain Face API features.
While the Cognitive Services SDK does not indicate this in detail, you can use plain REST API to do the same query and get to a more detailed error message.
I used PowerShell to invoke the REST API but you could also use Postman, curl – whichever you prefer.
The response is a little more detailed than what you get when using the SDK: