Computer Vision

Trong Nguyen 20 Reputation points
2025-07-04T07:48:03.61+00:00

I analyze the image by computer vision in the Python app.

I use azure.ai.vision.imageanalysis.ImageAnalysisClient, which has two methods, but both just accept either image_url like "https://learn.microsoft.com/....png" or image_data in binary.

So, I want to know if I can use images on my computer.

if not, can you tell me why?

Thanks for your care!

Computer Vision
Computer Vision
An Azure artificial intelligence service that analyzes content in images and video.
0 comments No comments
{count} votes

Accepted answer
  1. Pavankumar Purilla 10,350 Reputation points Microsoft External Staff Moderator
    2025-07-04T09:38:32.7966667+00:00

    Hi Trong Nguyen,

    You can analyze images stored on your local computer using the azure.ai.vision.imageanalysis.ImageAnalysisClient in Python by reading the image file as binary data and passing it to the client’s analyze method via the image_data parameter. The client does not accept local file paths directly because the Azure service operates in the cloud and cannot access files on your local filesystem. Instead, you need to open the image file in binary mode (e.g., using Python’s open("path/to/image.jpg", "rb")) and then send the binary content to the service. Alternatively, if you want to use the image_url parameter, the image must be publicly accessible via a valid HTTP or HTTPS URL. This design ensures the service can reliably access the image content for analysis. For more details, you can refer to the official Microsoft Azure SDK documentation for the Python azure-ai-vision package and the Image Analysis API, which explain that images can be provided either as URLs or as binary data, but not as local file paths.

    For more information: Azure Image Analysis client library for Python - version 1.0.0

    2 people found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

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.