【问题标题】:How to get the confidence scores for the Google Cloud Vision API logo detection?如何获取 Google Cloud Vision API 徽标检测的置信度分数?
【发布时间】:2020-06-10 03:37:19
【问题描述】:

如何找到 Google Vision API 的徽标检测方法的概率或可能性(置信度分数)?

我有一张图片,它为徽标提供了这些,但没有一个是正确的。我想在置信度得分方面为它使用一个阈值。

Logos:
Sogndal Fotball
Tequila Herradura

代码:

# Performs logo detection on the image file
response_logo = client.logo_detection(image=image)
logos = response_logo.logo_annotations
print('Logos:')

for logo in logos:
    print(logo.description)

if response_logo.error.message:
    raise Exception(
        '{}\nFor more info on error messages, check: '
        'https://cloud.google.com/apis/design/errors'.format(
            response_logo.error.message))

【问题讨论】:

  • 您是否经常得到错误的结果?

标签: google-cloud-platform google-cloud-vision google-apis-explorer


【解决方案1】:
# Performs logo detection on the image file
response_logo = client.logo_detection(image=image)
logos = response_logo.logo_annotations
print('Logos:')

logos_dict = {}
for logo in logos:
    print(logo.description)
    print('logo type: ', type(logo))
    print(logo)
    logos_dict.update({'logo': logo.description,
                       'logo_score': logo.score})

print(logos_dict)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-04-01
    • 1970-01-01
    • 1970-01-01
    • 2016-10-01
    • 2017-10-20
    • 2020-10-22
    • 1970-01-01
    相关资源
    最近更新 更多