I am using Spring org.springframework.cloud.gcp.vision.CloudVisionTemplate for detecing labels in an image using Google Vision API like below:
AnnotateImageResponse annotateImageResponse = cloudVisionTemplate.analyzeImage(imageResource,
Feature.Type.LABEL_DETECTION);
annotationList = annotateImageResponse.getLabelAnnotationsList();
By default it seems like, it only fetches 10 results, but we need all the labels detected. I went through the Google API doc and it mentions about a parameter maxResults
.
But this is described using REST API. I am looking how to set this maxResults
using spring CloudVisionTemplate
in Java or Google Vision Java SDK.