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; }