You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Symfony\Component\Debug\Exception\FatalThrowableError
Argument 1 passed to Vision\Annotation\Word::__construct() must be an instance of Vision\Annotation\TextProperty, null given, called in /project/vendor/jordikroon/google-vision/src/Hydrator/Strategy/WordsStrategy.php on line 82
$apiKey = 'test';
$vision = new \Vision\Vision(
$apiKey,
[
new \Vision\Feature(\Vision\Feature::TEXT_DETECTION, 100)
]
);
$imagePath = 'https://img.ali-img.net/img.alicdn.com/imgextra/i1/2243067373/O1CN01eE61ag24KskpsXLPX_!!2243067373.jpg_v_600.jpg';
$response = $vision->request(
new \Vision\Request\Image\RemoteImage($imagePath)
);
dd($response);
public function hydrate($value)
{
$wordEntities = [];
foreach ($value as $wordEntityInfo) {
$textProperty = isset($wordEntityInfo['property'])
? $this->textPropertyStrategy->hydrate($wordEntityInfo['property'])
: null;
$boundingBox = isset($wordEntityInfo['boundingBox'])
? $this->boundingPolyStrategy->hydrate($wordEntityInfo['boundingBox'])
: null;
$symbols = isset($wordEntityInfo['symbols'])
? $this->symbolsStrategy->hydrate($wordEntityInfo['symbols'])
: null;
// $textProperty is null, Cause an error
$wordEntities[] = new Word(
$textProperty,
$boundingBox,
$symbols
);
}
return $wordEntities;
}
The text was updated successfully, but these errors were encountered:
Symfony\Component\Debug\Exception\FatalThrowableError
Argument 1 passed to Vision\Annotation\Word::__construct() must be an instance of Vision\Annotation\TextProperty, null given, called in /project/vendor/jordikroon/google-vision/src/Hydrator/Strategy/WordsStrategy.php on line 82
The text was updated successfully, but these errors were encountered: