Analyze Image API InvalidImageSize

Pooser, Benjamin P 6 Reputation points
2020-10-09T23:04:50.62+00:00

Hello!

We are a college team trying to create a food waste reducing app using React Native, and our goal is to use the Analyze Image API.

My team is trying to send the HTTP request to analyze an image using the Analyze Image API and we are adding FormData as the request body with the local image from the device. Some images are able to get the 200 status response, but many of them gives us the error InvalidImageSize, even if the image is less than 4 mb. We are not sure why this would happen, but our guess is that while making the FormData for the HTTP request it makes the image too large.

Is there any way instead of FormData to unload local image from the device or simulator and not use the url from online? Any help would be greatly appreciated. Thanks!

Azure AI Custom Vision
Azure AI Custom Vision
An Azure artificial intelligence service and end-to-end platform for applying computer vision to specific domains.
197 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,195 questions
{count} vote

1 answer

Sort by: Most helpful
  1. Ramr-msft 17,441 Reputation points
    2020-10-16T08:22:16.067+00:00

    Thanks for the details. Here is the quick start sample for analyze local image using computer vision REST API and C#. Please follow the below quick-start and snapshot of the response for the input image that you are trying.
    https://learn.microsoft.com/en-us/azure/cognitive-services/computer-vision/quickstarts/csharp-analyze
    32922-image.png

    0 comments No comments