如下面的链接所述,如果我们需要访问与计算机视觉API端点不同的“”URL来访问结果,就会遇到麻烦。
使用计算机视觉REST和Python提取打印和手写文本
你能帮个忙吗。
发布于 2020-09-29 04:54:15
您可以使用COMPUTER_VISION_ENDPOINT,例如https://westus2.api.cognitive.microsoft.com,而不是使用“Operation”URL。
text_recognition_url = endpoint + "/vision/v3.0/read/analyze"
# Set image_url to the URL of an image that you want to recognize.
image_url = "https://raw.githubusercontent.com/MicrosoftDocs/azure-docs/master/articles/cognitive-services/Computer-vision/Images/readsample.jpg"
headers = {'Ocp-Apim-Subscription-Key': subscription_key}
data = {'url': image_url}
response = requests.post(
text_recognition_url, headers=headers, json=data)
response.raise_for_status()
https://stackoverflow.com/questions/64111973
复制相似问题