如何获得Google Cloud Vision API徽标检测的置信度分数?

问题描述 投票:0回答:1

如何找到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个回答
0
投票
# 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)
© www.soinside.com 2019 - 2024. All rights reserved.