Computer vision 使用“访问时遇到问题;服务端点&x201D;启用计算机视觉认知服务

Computer vision 使用“访问时遇到问题;服务端点&x201D;启用计算机视觉认知服务,computer-vision,azure-cognitive-services,Computer Vision,Azure Cognitive Services,如下面的链接所述,如果我们需要使用与Computer Vision API端点不同的“Operation Location”URL访问结果,则会遇到问题 使用计算机视觉REST API和Python提取打印和手写文本 请您在这方面提供帮助。您可以使用计算机视觉端点,而不是使用“操作位置”URL text_recognition_url = endpoint + "/vision/v3.0/read/analyze" # Set image_url to the URL o

如下面的链接所述,如果我们需要使用与Computer Vision API端点不同的“Operation Location”URL访问结果,则会遇到问题

使用计算机视觉REST API和Python提取打印和手写文本

请您在这方面提供帮助。

您可以使用计算机视觉端点,而不是使用“操作位置”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()