I am matching selfie face with album photos using Face Rekognition PHP SDK.
for that, I am go through the user selfies loop and check one by one. and it's taking around 15 minutes to get result.
Here, the my code snippet that I performed.
<?php
foreach ( $user_bio_selfies as $selfi ) {
$selfi_path = $user_selfi_path . $selfi['image'];
if ( file_exists( $selfi_path ) ) {
$binary_target_face_image = file_get_contents($selfi_path);
try {
$compareFaces = array(
'QualityFilter' => 'HIGH',
'SimilarityThreshold' => 70,
'SourceImage' => array(
'Bytes' => $binary_source_face_image,
),
'TargetImage' => array(
'Bytes' => $binary_target_face_image,
),
);
$result = $this->client->compareFaces($compareFaces);
$response = $result->toArray();
if ( !empty( $response['FaceMatches'] ) ) {
$matched_face = number_format($response['FaceMatches'][0]['Face']['Confidence'], 2, '.', '');
if ( $matched_face >= 30 ) {
$matched_images[] = array(
'image' => base_url(USER_IMAGE_SITE_PATH) . $selfi['image'],
'confidence' => $matched_face,
);
}
}
} catch (Exception $e) { }
}
}
is there any way to match selfies with chuck of images at a time in AWS Rekognition?