Created
December 19, 2017 16:52
-
-
Save AlexChesters/d5ab7dad69fd8ea158e58e93162c12a9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto3 | |
client = boto3.client(‘rekognition’, region_name=’eu-west-1') | |
def compare_faces(source_image_path, target_image_path): | |
source_image = open(source_image_path, ‘rb’) | |
target_image = open(target_image_path, ‘rb’) | |
response = client.compare_faces( | |
SourceImage={‘Bytes’: bytearray(source_image.read())}, | |
TargetImage={‘Bytes’: bytearray(target_image.read())} | |
) | |
return response[‘FaceMatches’] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment