Example: use Google\Cloud\ServiceBuilder; $cloud = new ServiceBuilder(); $vision = $cloud->vision(); $imageResource = fopen(__DIR__ .'/assets/family-photo.jpg', 'r'); $image = $vision->image($imageResource, [ 'text' ]); $annotation = $vision->annotate($image); $text = $annotation->text()[0];
See also: https://cloud.google.com/vision/reference/rest/v1/images/annotate#entityannotation EntityAnnotation
Inheritance: extends AbstractFeature, use trait Google\Cloud\CallTrait
 public function testEntity()
 {
     $res = ['foo' => 'bar'];
     $e = new Entity($res);
     $this->assertEquals($res, $e->info());
     $this->assertEquals('bar', $e->foo());
 }