OCR Demo on Vision Studio performs better than API call

Danny Zhang 20 Reputation points
2024-09-01T04:32:29.5933333+00:00

I've been testing out Optical Character Recognition using Azure. However, I've noticed that the online demo version performs far better than the API version. In addition, the API model version is stuck on 2023-10-01 instead of the 2024 version shown in the documentation. Can someone explain the discrepancy?

Azure Computer Vision
Azure Computer Vision
An Azure artificial intelligence service that analyzes content in images and video.
379 questions
{count} votes

4 answers

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  3. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  4. navba-MSFT 24,910 Reputation points Microsoft Employee
    2024-09-05T03:57:44.7233333+00:00

    @Danny Zhang Thanks for getting back nd clarifying your ask. This api-version is supported 2024-02-01. However the SDK is not yet updated to use this new version and it is still using older version 2023-10-01.

    .

    So, if you want to use this 2024-02-01 api-version, try directly invoking it from the REST API as shown below:

    POST https://XXXX.cognitiveservices.azure.com/computervision/imageanalysis:analyze?features=caption%2Cread&api-version=2024-02-01&gender-neutral-caption=true 
    Content-Type: application/json 
    Ocp-Apim-Subscription-Key: 337e4XXXXXXX4633cd7f 
    Request Body:
    
    {"url":"https://learn.microsoft.com/azure/ai-services/computer-vision/media/quickstarts/presentation.png"}
    
    

    .

    .

    So, if you want to use this 2024-02-01 api-version, try directly invoking it from the Python code via REST API as shown below:

    import requests
    
    # Define the endpoint and parameters
    
    url = "https://XXXX.cognitiveservices.azure.com/computervision/imageanalysis:analyze"
    
    params = {
    
        'features': 'caption,read',
    
        'api-version': '2024-02-01',
    
        'gender-neutral-caption': 'true'
    
    }
    
    # Define the headers
    
    headers = {
    
        'Content-Type': 'application/json',
    
        'Ocp-Apim-Subscription-Key': '337e4XXXXXXX4633cd7f'
    
    }
    
    # Define the request body
    
    data = {
    
        'url': 'https://learn.microsoft.com/azure/ai-services/computer-vision/media/quickstarts/presentation.png'
    
    }
    
    # Make the POST request
    
    response = requests.post(url, headers=headers, params=params, json=data)
    
    # Print the response
    
    print(response.status_code)
    
    print(response.json())
    
    

    Hope this helps. If you have any follow-up questions, please let me know. I would be happy to help.

    ** Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.