在C#中使用使用相同区域/键的Azure计算机视觉API服务没有任何问题,但是Python给了我一些方便。我不能从网上分析任何东西。下面是示例中的片段:
_region = 'westus' #Here you enter the region of your subscription
_url = 'https://{}.api.cognitive.microsoft.com/vision/v1.0'.format(_region)
_key = "<my API Key>"
_maxNumRetries = 10
# URL direction to image
urlImage = "https://oxfordportal.blob.core.windows.net/vision/Analysis/1-1.jpg"
# Computer Vision parameters
params = { 'visualFeatures' : 'Color,Categories'}
headers = dict()
headers['Ocp-Apim-Subscription-Key'] = _key
headers['Content-Type'] = 'application/json'
json = { 'url': urlImage }
data = None
result = processRequest( json, data, headers, params )我尝试了无数的图像,上面的变化,但我从来没有得到任何东西,除了404 -资源没有发现错误。我哪里出问题了?这是服务或URL的问题吗?提亚
发布于 2018-06-12 02:31:40
把这个写在“没关系”下面。这个问题是因为在url之后缺少了一个斜线。我是从Azure复制链接的,但是它不会自动添加链接,我在代码中漏掉了它。
https://stackoverflow.com/questions/50808403
复制相似问题