Hello good afternoon I am using the aws SDK and php but I get an error and I do not know how to solve it I would appreciate your help very much thanks in advance.
require '../../vendor/autoload.php';
use Aws\Rekognition\RekognitionClient;
$credentials = new Aws\Credentials\Credentials('*******', '******');
$rekognitionClient = RekognitionClient::factory(array(
'region' => 'us-east-2',
'version' => 'latest',
'credentials' => $credentials,
//'debug' => true,
));
$compareFaceResults= $rekognitionClient->compareFaces([
'SimilarityThreshold' => 80,
'SourceImage' => [
'Bytes' => file_get_contents("test.jpg")
],
'TargetImage' => [
'Bytes' => file_get_contents("test1.jpg")
],
]);
$FaceMatchesResult = $compareFaceResults['FaceMatches'];
$SimilarityResult = $FaceMatchesResult['Similarity']; //Here You will get similarity
$sourceImageFace = $compareFaceResults['SourceImageFace'];
$sourceConfidence = $sourceImageFace['Confidence']; //Here You will get confidence of the picture
'Error retrieving credentials from the instance profile metadata server. (cURL error 28: Connection timed out after 1000 milliseconds (see link )) 'in C: \ xampp \ vendor \ aws \ aws-sdk-php \ src \ Credentials \ InstanceProfileProvider.php: 88 Stack trace: # 0 C: \ xampp \ vendor \ guzzlehttp \ promises \ src \ Promise.php (203): Aws \ Credentials \ InstanceProfileProvider- > Aws \ Credentials {Closure} (Array) # 1 C: \ xampp \ vendor \ guzzlehttp \ promises \ src \ Promise.php (156): GuzzleHttp \ Promise \ Promise :: callHandler (2, Array, Array ) # 2 C: \ xampp \ vendor \ guzzlehttp \ promises \ src \ TaskQueue.php (47): GuzzleHttp \ Promise \ Promise :: GuzzleHttp \ Promise {closure} () # 3 C: \ xampp \ vendor \ guzzlehttp \ guzzle \ src \ Handler \ CurlMultiHandler.php (98): GuzzleHttp \ Promise \ TaskQueue->> run () # 4 C: \ xampp \ vendor \ guzzlehttp \ guzzle \ src \ Handler \ CurlMultiHandler.php (125): GuzzleHttp \ Handler \ CurlMultiHandler-> tick () # 5 C: \ xampp \ vendor \ guzzlehttp \ promises \ src \ Promise.php (246): Gu in C: \ xampp \ vendor \ aws \ aws-sdk-php \ src \ Credentials \ InstanceProfileProvider.php on line 88