Azure Face API Error(Python, Curl, Microsoft Doc Try it)

治猷 張 21 Reputation points
2022-09-19T04:18:54.98+00:00

I have already apply my own Azure Face Api also get my Endpoint and Key, but here comes some error messages without detail.

What I tried:

  1. [Python]azure.cognitiveservice.vision.face.FaceClient.detect_with_stream: azure.cognitiveservices.vision.face.models._models_py3.APIErrorException: (InvalidRequest) Invalid request has been sent.
  2. [Python]azure.cognitiveservice.vision.face.FaceClient.detect_with_url:azure.cognitiveservices.vision.face.models._models_py3.APIErrorException: (InvalidRequest) Invalid request has been sent.
  3. [curl]base64IMG:{"error":{"code":"BadArgument","message":"JSON parsing error."}}
  4. [curl]url:[{"faceRectangle":{"top":384,"left":1004,"width":653,"height":653}}] (succed)
  5. [Doc]detect_with_stream:{"error":{"code":"BadArgument","message":"JSON parsing error."}}
  6. [Doc]detect_with_url:[{"faceRectangle":{"top":384,"left":1004,"width":653,"height":653}}] (succed)

Problem:

  1. I don't know what's the detail of error from my first two try:InvalidRequest. According to this page, I thought that the problem is I have to apply Azure Cognitive Services Facial Recognition Limited Access Review, but my fourth try just passed(curl with url by my own enpoint, apikey without apply Limited Access Review).
  2. I don't know how to use face api of detect_with_stream, whether it's RESTful API or lib of python. There is no example in Doc and there is only one hint about the request body:"{Image binary in base 64 format}". I tried to use python to convert IMG to base64, but it just failed with parsing error code.
Azure Face
Azure Face
An Azure service that provides artificial intelligence algorithms that detect, recognize, and analyze human faces in images.
150 questions
Azure AI services
Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
2,354 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. YutongTie-MSFT 46,091 Reputation points
    2022-09-19T23:49:36.243+00:00

    Hello @治猷 張

    Thanks for using Microsoft Q&A. I think you are mentioning two questions, one is Face API limitation, the other one is about analyze faces in real time video/ stream.

    For the first question, you need to apply for access or you can not run the API even you have input some data in it. 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. Use the Face Recognition intake form to apply for access.

    I apologize for all inconveniences.

    For the second question, the doc you are looking at is not the official product document, please refer to the offcial doc part about how to perform near-real-time analysis on frames taken from a live video stream. And there is an exampe - https://learn.microsoft.com/en-us/azure/cognitive-services/computer-vision/how-to/identity-analyze-video?source=recommendations

    I hope this helps! I will highly recommend you to apply for access and then have a try on this example.

    Regards,
    Yutong

    -Please kindly accept the answer if you feel helpful to support the community, thanks a lot.