This commit is contained in:
KANE LAZENI 2026-02-24 00:35:46 +00:00
parent 8d48a1d12d
commit adc8fe66a6

View File

@ -64,7 +64,7 @@ class FacialVerificationAPI {
var_dump( var_dump(
array( array(
"referenceImagePath" => $referenceImagePath, "referenceImagePath" => $referenceImagePath,
"capturedImageBase64" => $capturedImageBase64, // "capturedImageBase64" => $capturedImageBase64,
"photoAssureCrypte" => $_SESSION['photoAssureCrypte'], "photoAssureCrypte" => $_SESSION['photoAssureCrypte'],
"lienPhoto" => $_SESSION['lienPhoto'], "lienPhoto" => $_SESSION['lienPhoto'],
) )
@ -84,19 +84,20 @@ class FacialVerificationAPI {
try { try {
$rekognitionClient = new Aws\Rekognition\RekognitionClient([ $rekognitionClient = new Aws\Rekognition\RekognitionClient([
'version' => 'latest', 'version' => 'latest',
'region' => AWS_REGION, 'region' => 'us-west-2',
'credentials' => [ 'credentials' => [
'key' => AWS_ACCESS_KEY_ID, 'key' => 'AKIA2O2PTXQ7XN5OATO3',
'secret' => AWS_SECRET_ACCESS_KEY 'secret' => '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'
] ]
]); ]);
$referenceImageData = file_get_contents($referenceImagePath); $referenceImageData = file_get_contents($referenceImagePath);
$capturedImageData = base64_decode(explode(',', $capturedImageBase64)[1]); $capturedImageData = base64_decode(explode(',', $capturedImageBase64)[1]);
$result = $rekognitionClient->compareFaces([ $result = $rekognitionClient->compareFaces([
'SourceImage' => ['Bytes' => $referenceImageData], 'SourceImage' => ['Bytes' => $capturedImageData],
'TargetImage' => ['Bytes' => $capturedImageData], 'TargetImage' => ['Bytes' => $referenceImageData],
'SimilarityThreshold' => 80 'SimilarityThreshold' => 80
]); ]);