ai-fundamentals icon indicating copy to clipboard operation
ai-fundamentals copied to clipboard

resource not foun - 01a - Image Analysis with Computer Vision

Open MichielBbal opened this issue 3 years ago • 1 comments

I use anaconda to run 01a - Image Analysis with Computer Vision.ipynb.

I get a 'resource not found' error, however the store_cam1.jpg file is in the right folder.

Here is the code: from azure.cognitiveservices.vision.computervision import ComputerVisionClient from msrest.authentication import CognitiveServicesCredentials from python_code import vision import os %matplotlib inline

'# Get the path to an image file image_path = os.path.join('data', 'vision', 'store_cam1.jpg')

'# Get a client for the computer vision service computervision_client = ComputerVisionClient(cog_endpoint, CognitiveServicesCredentials(cog_key))

'# Get a description from the computer vision service image_stream = open(image_path, "rb")# description = computervision_client.describe_image_in_stream(image_stream)

'# Display image and caption (code in helper_scripts/vision.py) vision.show_image_caption(image_path, description)

Here is the error message:


ComputerVisionErrorException Traceback (most recent call last) in 13 # Get a description from the computer vision service 14 image_stream = open(image_path, "rb")# ---> 15 description = computervision_client.describe_image_in_stream(image_stream) 16 17 # Display image and caption (code in helper_scripts/vision.py)

~\Anaconda3\lib\site-packages\azure\cognitiveservices\vision\computervision\operations_computer_vision_client_operations.py in describe_image_in_stream(self, image, max_candidates, language, description_exclude, custom_headers, raw, callback, **operation_config) 1100 1101 if response.status_code not in [200]: -> 1102 raise models.ComputerVisionErrorException(self._deserialize, response) 1103 1104 deserialized = None

ComputerVisionErrorException: Operation returned an invalid status code 'Resource Not Found'

MichielBbal avatar Dec 31 '20 08:12 MichielBbal

And in Azure ML studio I get the same error.... and you can see I have the store_cam1.jpg in the right folder

image

MichielBbal avatar Dec 31 '20 16:12 MichielBbal