PHP Класс Google\Cloud\Vision\Annotation

Example: use Google\Cloud\ServiceBuilder; $cloud = new ServiceBuilder(); $vision = $cloud->vision(); $imageResource = fopen(__DIR__ .'/assets/family-photo.jpg', 'r'); $image = $vision->image($imageResource, [ 'FACE_DETECTION' ]); $annotation = $vision->annotate($image);
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( array $info ) Create an annotation result.
error ( ) : array | null Get error information, if present
faces ( ) : Face[] | null Return an array of faces
imageProperties ( ) : ImageProperties | null Fetch image properties
info ( ) : array | null Return raw annotation response array
labels ( ) : Entity[] | null Return an array of labels
landmarks ( ) : Entity[] | null Return an array of landmarks
logos ( ) : Entity[] | null Return an array of logos
safeSearch ( ) : SafeSearch | null Get the result of a safe search detection
text ( ) : Entity[] | null Return an array containing all text found in the image

Описание методов

__construct() публичный Метод

This class represents a single image annotation response from Cloud Vision. If multiple images were tested at once, the result will be an array of Annotation instances. This class is not intended to be instantiated outside the Google Cloud Platform Client Library.
public __construct ( array $info )
$info array The annotation result

error() публичный Метод

Example: $error = $annotation->error();
См. также: https://cloud.google.com/vision/reference/rest/v1/images/annotate#status Status Format
public error ( ) : array | null
Результат array | null

faces() публичный Метод

Example: $faces = $annotation->faces();
public faces ( ) : Face[] | null
Результат Google\Cloud\Vision\Annotation\Face[] | null

imageProperties() публичный Метод

Example: $properties = $annotation->imageProperties();
public imageProperties ( ) : ImageProperties | null
Результат Google\Cloud\Vision\Annotation\ImageProperties | null

info() публичный Метод

Example: $info = $annotation->info();
См. также: https://cloud.google.com/vision/reference/rest/v1/images/annotate#annotateimageresponse AnnotateImageResponse
public info ( ) : array | null
Результат array | null

labels() публичный Метод

Example: $labels = $annotation->labels();
public labels ( ) : Entity[] | null
Результат Google\Cloud\Vision\Annotation\Entity[] | null

landmarks() публичный Метод

Example: $landmarks = $annotation->landmarks();
public landmarks ( ) : Entity[] | null
Результат Google\Cloud\Vision\Annotation\Entity[] | null

logos() публичный Метод

Example: $logos = $annotation->logos();
public logos ( ) : Entity[] | null
Результат Google\Cloud\Vision\Annotation\Entity[] | null

safeSearch() публичный Метод

Example: $safeSearch = $annotation->safeSearch();
public safeSearch ( ) : SafeSearch | null
Результат Google\Cloud\Vision\Annotation\SafeSearch | null

text() публичный Метод

Example: $text = $annotation->text();
public text ( ) : Entity[] | null
Результат Google\Cloud\Vision\Annotation\Entity[] | null