0
votes

I'm using Google Vision API, yet I've noticed that it is limited for the top 10 labels, and does not return results under 70% confidence.

Is there a setting or a way to receive results that are lower than the 70% threshold?

2

2 Answers

1
votes

There is no limit for lower percentuage.

You can set in your request, the "maxResults": number of every type of feature searched.

Link to documentation: https://cloud.google.com/vision/docs/reference/rest/v1/images/annotate#AnnotateImageRequest

0
votes

I will leave you an example to set up the 'maxResults' for Google API Vision, you can put 50 results to be returned if you want to, but you'll get as much as the image and the google's model can provide:

# Libraries
import os
from google.cloud import vision

#JSON credential file
os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = 'your_path.json'

# Client
client = vision.ImageAnnotatorClient()

# Img uri
image = vision.Image()
image.source.image_uri = 'https://www.url.jpg'

## function with MAX_RESULTS=50, 

response_label = client.label_detection(image=image,max_results=50)
cnt=0
for label in response_label.label_annotations:
    cnt+=1
    print('Label {}:'.format(cnt), label.description, ' / Score', label.score)