Share via

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.

Locked Question. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes
Answer accepted by question author
  1. Pavankumar Purilla 11,495 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

1 additional answer

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