【发布时间】:2020-01-29 17:29:24
【问题描述】:
我正在尝试从网站上抓取图像并使用 Google Cloud Vision API 来检测网站上的图像是否是徽标。如果我为它提供一个像 Apple 这样的标志,它就可以工作,但它似乎不适用于众所周知的非财富 500 强科技公司标志(例如 LaunchDarkly、LogDNA 等),尽管这些图像显然是标志。它应该适用于任何类型的标志还是只适用于大品牌?有没有更适合我需求的解决方案?
client = vision.ImageAnnotatorClient()
with io.open('./img.png', 'rb') as image_file:
content = image_file.read()
image = vision.types.Image(content=content)
response = client.logo_detection(image=image)
logos = response.logo_annotations
for logo in logos:
print(logo.description)
print(logo.score)
if response.error.message:
raise Exception(
'{}\nFor more info on error messages, check: '
'https://cloud.google.com/apis/design/errors'.format(
response.error.message))
【问题讨论】:
标签: python machine-learning computer-vision google-vision