Vision/src/VisionClient.php
public function annotateBatch(array $images, array $options = [])
    {
        $this->validateBatch($images, Image::class);

        $requests = [];
        foreach ($images as $image) {
            $requests[] = $image->requestObject();
        }

        $res = $this->connection->annotate([
            'requests' => $requests
        ] + $options);

        $annotations = [];
        if (isset($res['responses'])) {
            foreach ($res['responses'] as $response) {
                $annotations[] = new Annotation($response);
            }
        }

        return $annotations;
    }
public function annotateBatch(array $images, array $options = [])
    {
        $this->validateBatch($images, Image::class);

        $requests = [];
        foreach ($images as $image) {
            $requests[] = $image->requestObject();
        }

        $res = $this->connection->annotate([
            'requests' => $requests
        ] + $options);

        $annotations = [];
        if (isset($res['responses'])) {
            foreach ($res['responses'] as $response) {
                $annotations[] = new Annotation($response);
            }
        }

        return $annotations;
    }
public function annotateBatch ( array $ images , array $ options = [ ] ) { $ this -> validateBatch ( $ images , Image :: class ) ; $ requests = [ ] ; foreach ( $ images as $ image ) { $ requests [ ] = $ image -> requestObject ( ) ; } $ res = $ this -> connection -> annotate ( [ 'requests' => $ requests ] + $ options ) ; $ annotations = [ ] ; if ( isset ( $ res [ 'responses' ] ) ) { foreach ( $ res [ 'responses' ] as $ response ) { $ annotations [ ] = new Annotation ( $ response ) ; } } return $ annotations ; }
Annotate a set of images.

Example:
```
$images = [];

$familyPhotoResource = fopen(__DIR__ . '/assets/family-photo.jpg', 'r');
$eiffelTowerResource = fopen(__DIR__ . '/assets/eiffel-tower.jpg', 'r');

$images[] = $vision->image($familyPhotoResource, [
'FACE_DETECTION'
]);

$images[] = $vision->image($eiffelTowerResource, [
'LANDMARK_DETECTION'
]);

$result = $vision->annotateBatch($images);
```

@see https://cloud.google.com/vision/docs/reference/rest/v1/images/annotate Annotate API documentation

@param  Image[] $images An array consisting of instances of
{@see Google\Cloud\Vision\Image}.
@param  array $options Configuration Options
@return Annotation[]
Annotate a set of images .