I am trying to request more than 10 results using ImageAnnotatorClient and getLabelAnnotations but cannot find a solution, who can that be done?
Thanks!
Hi @joseflorido,
You can provide a custom value to max_results when configuring a feature:
use Google\Cloud\Vision\V1\Feature;
use Google\Cloud\Vision\V1\Feature\Type;
use Google\Cloud\Vision\V1\ImageAnnotatorClient;
$client = new ImageAnnotatorClient();
$res = $client->annotateImage(fopen(__DIR__ . '/image.jpg', 'r'), [
new Feature([
'type' => Type::LABEL_DETECTION,
'max_results' => 20
])
]);
Please continue the conversation if you have any issues!
Thanks! This worked perfectly :)
Thank you so much, was wasting hours trying to get this right!
Most helpful comment
Hi @joseflorido,
You can provide a custom value to
max_resultswhen configuring a feature:Please continue the conversation if you have any issues!