( ′∀`)σ≡σ☆))Д′)レ(゚∀゚;)ヘ=З=З=Зε≡(ノ´_ゝ`)ノ
<?php
require 'vendor/autoload.php';
use Aws\Rekognition\RekognitionClient;
$client = new Aws\Rekognition\RekognitionClient([
'version' => 'latest',
'region' => 'us-east-1',
'credentials' => [
'key' => 'AKIA5FTC5KABEDM7TM76',
'secret' => '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'
]
]);
$result = $client->detectText([
'Image' => [
'S3Object' => [
'Bucket' => 'brandextract',
'Name' => 'arylide-yellow-illustration-beauty-skincare-twitter-ad-rlxncR-ii3o.jpg',
],
],
]);
echo json_encode($result['TextDetections']);
exit();
echo "<h1>Rekognition</h1>";
$i=0;
echo "<table border=1 cellspacing=0><tr><td>#</td><td>DetectedText</td><td>Type</td><td>ID</td><td>ParentId</td><td>Confidence</td></tr>";
foreach ($result['TextDetections'] as $phrase) {
$i++;
echo "<tr><td>$i</td><td>".$phrase['DetectedText']."</td><td>".$phrase['Type']."</td><td>".$phrase['Id']."</td><td>".$phrase['ParentId']."</td><td>".round($phrase['Confidence'])."%</td></tr>";
}
echo "</table>";
//echo "<h1>Raw Output</h1><pre>";
//print_r($result);
//echo "</pre>";
?>