如何获得 Google Cloud Vision API 徽标检测的置信度分数?
How to get the confidence scores for the Google Cloud Vision API logo detection?
如何找到 Google Vision API 徽标检测方法的概率或可能性(置信度得分)?
我有一张图片为徽标提供了这些图片,而 none 是正确的。我想在置信度得分方面为其使用阈值。
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))
# 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)
如何找到 Google Vision API 徽标检测方法的概率或可能性(置信度得分)?
我有一张图片为徽标提供了这些图片,而 none 是正确的。我想在置信度得分方面为其使用阈值。
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))
# 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)