I have a problem with Computer Vision resource on Azure. This code is based on documentation example and it already worked.(https://docs.microsoft.com/en-us/azure/cognitive-services/computer-vision/quickstarts/python-disk)
Suddenly i started getting 400 error:
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://nameofmyresource.cognitiveservices.azure.com/vision/v2.0/analyze?visualFeatures=Objects%2CTags
My piece of code:
for img_path in img_path_list:
image_data = open(img_path, "rb").read()
print(image_data)
headers = {'Ocp-Apim-Subscription-Key': subscription_key,
'Content-Type': 'application/octet-stream'}
params = {'visualFeatures': 'Objects,Tags'}
response = requests.post(
analyze_url, headers=headers, params=params, data=image_data)
response.raise_for_status()
analysis = response.json()
I've printed image_data (seems okay) and created new resource - nothing. Any thoughts?