question

Laura18 avatar image
0 Votes"
Laura18 asked romungi-MSFT commented

key error = "Operation-Location"

Using the code from here: https://github.com/Azure-Samples/cognitive-services-quickstart-code/blob/master/python/ComputerVision/REST/python-hand-text.md

I iterate over the code to detect text in multiple local images (around 100 images); however, I get key error = "Operation-Location" after a few number of iterations varying every rerun. How do I go about fixing it?

azure-computer-vision
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

romungi-MSFT avatar image
0 Votes"
romungi-MSFT answered romungi-MSFT commented

@Laura18 The sample you referenced is using an image url to call the API. Have you modified your code to pass the local file as binary stream to the read API?
If Yes, for a successful operation the result will contain an operation location. Basically an id that needs to be passed to another API called read result API to get the actual result of your first read operation.
Since you are receiving an error I think the Read API call is not successful.

I would recommend to follow steps in this sample instead, since you are using local images. It is east to modify to loop through your images and provide a read result.


· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@romungi-MSFT Yes, I modified the code to pass the local file using the code from here: https://stackoverflow.com/questions/63907566/using-local-image-for-read-3-0-azure-cognitive-service-computer-vision

I have tried the sample you gave; however, I ran into this error: 'ComputerVisionOcrErrorException: Operation returned an invalid status code 'Quota Exceeded'

Thank you for the information! I will look into the Read API call.

0 Votes 0 ·

@Laura18 I think the quota error is because of the pricing tier chosen for your resource. If you could upgrade to a higher tier you can use the sample to pass multiple requests at once.


0 Votes 0 ·