Azure Computer Vision - detect_objects (Image URL is not accessible)

benjaminsultan-6886 0 Reputation points
2023-11-26T06:52:52.3966667+00:00

I try to run detect_objects on a image that is in my container_blobs, not available on the net like that:

detected_objects=computervision_client.detect_objects(visual_features=visual_features, url=image_url)

i get the error:

User's image

how can i run this function on my image please?

Azure Computer Vision
Azure Computer Vision
An Azure artificial intelligence service that analyzes content in images and video.
347 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,637 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Sreeju Nair 12,176 Reputation points
    2023-11-26T12:35:42.6133333+00:00

    Hi Benjamin Sultan,

    Based on your query, I believe you need to run the detect_objects API on an image in a container, but not available publicly. As per the specification of the API, the Image URL parameter expects a publicly reachable URL of an image, so it can not work on your private images passed to it as URL.

    Refer:

    https://learn.microsoft.com/en-us/rest/api/computervision/detect-objects/detect-objects?view=rest-computervision-v3.1&tabs=HTTP#request-body

    https://learn.microsoft.com/en-us/rest/api/computervision/detect-objects/detect-objects?view=rest-computervision-v3.1&tabs=HTTP#imageurl

    https://learn.microsoft.com/en-us/rest/api/computervision/detect-objects/detect-objects?view=rest-computervision-v3.1&tabs=HTTP

    If you can not make your image publicly available, you may use Dected Objects in a Stream API. In this, you may pass Image data to the API. from your code, you may extract the binary data of the image in your container and then pass it to the API.

    Refer: https://learn.microsoft.com/en-us/rest/api/computervision/detect-objects-in-stream/detect-objects-in-stream?view=rest-computervision-v3.1&tabs=HTTP

    https://learn.microsoft.com/en-us/rest/api/computervision/detect-objects-in-stream/detect-objects-in-stream?view=rest-computervision-v3.1&tabs=HTTP#request-body

    Hope this helps