【问题标题】:Facing trouble accessing with “Service Endpoint” enabled on the Computer Vision Cognitive services [closed]在计算机视觉认知服务上启用“服务端点”时面临访问问题[关闭]
【发布时间】:2021-01-14 14:44:30
【问题描述】:
【问题讨论】:
标签:
computer-vision
azure-cognitive-services
【解决方案1】:
您可以使用 COMPUTER_VISION_ENDPOINT,例如 https://westus2.api.cognitive.microsoft.com,而不是使用“操作位置”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()