public __construct ( array $info ) | ||
$info | array | The annotation result |
public function __construct($info)
{
$this->info = $info;
if (isset($info['faceAnnotations'])) {
$this->faces = [];
foreach ($info['faceAnnotations'] as $face) {
$this->faces[] = new Face($face);
}
}
if (isset($info['landmarkAnnotations'])) {
$this->landmarks = [];
foreach ($info['landmarkAnnotations'] as $landmark) {
$this->landmarks[] = new Entity($landmark);
}
}
if (isset($info['logoAnnotations'])) {
$this->logos = [];
foreach ($info['logoAnnotations'] as $logo) {
$this->logos[] = new Entity($logo);
}
}
if (isset($info['labelAnnotations'])) {
$this->labels = [];
foreach ($info['labelAnnotations'] as $label) {
$this->labels[] = new Entity($label);
}
}
if (isset($info['textAnnotations'])) {
$this->text = [];
foreach ($info['textAnnotations'] as $text) {
$this->text[] = new Entity($text);
}
}
if (isset($info['safeSearchAnnotation'])) {
$this->safeSearch = new SafeSearch($info['safeSearchAnnotation']);
}
if (isset($info['imagePropertiesAnnotation'])) {
$this->imageProperties = new ImageProperties($info['imagePropertiesAnnotation']);
}
if (isset($info['error'])) {
$this->error = $info['error'];
}
}