AWS Rekognition


Amazon Rekognition can be used to add image and video analysis to applications. For any given image or video the Rekognition API can identify objects, people, text, scenes, and activities. It can detect any inappropriate content as well. It provides facial analysis and facial recognition. It can detect, analyze, and compare faces for a wide variety of use cases, including user verification, cataloging, people counting, and public safety.

Amazon Rekognition makes images and stored videos searchable so that we can discover objects and scenes that appear within them.

A sample application using Rekognition API for facial recognition would look like this:

import boto3

if __name__ == "__main__":
    bucket='bucket'
    collectionId='Sample Collection'
    threshold = 40
    maxFaces=3
    faceId='xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'

    client=boto3.client('rekognition')
    response=client.search_faces(CollectionId=collectionId,
                                FaceId=faceId,
                                FaceMatchThreshold=threshold,
                                MaxFaces=maxFaces)
                        
    faceMatches=response['FaceMatches']
    print 'Matched faces'
    for match in faceMatches:
            print 'Matching FaceId:' + match['Face']['FaceId']
            print 'Face Similarity: ' + "{:.3f}".format(match['Similarity']) + "%"