Face detection and matching, using Amazon Image Rekognition
Launched in 2016, Amazon Rekognition allows us to detect objects, compare faces, and moderate images and video for any unsafe content. This is only a few of the many features it delivers.
- With Amazon Rekognition Custom Labels, you can tag the objects in images or stills from videos that are specific to your business. For example, if there is an image of a machine that’s a part of your assembly line, you can tag specific parts of the machine that are useful for your business.
- Amazon Rekognition is a cloud-based Software as a service (SaaS) computer vision platform that was launched in 2016. It has been sold and used by a number of United States government agencies, including U.S. Immigration and Customs Enforcement (ICE).
- Rekognition can directly process images stored in Amazon Simple Storage Service (S3). In fact, you can use AWS Lambda functions to process newly uploaded photos at any desired scale. You can use AWS Identity and Access Management (IAM) to control access to the Rekognition APIs.
- Pricing: As part of the AWS Free Tier, you can get started with Amazon Rekognition Image for free. Upon sign-up, new Amazon Rekognition customers can analyze 5,000 images per month for the first 12 months. After that price is around $1 for 1000 images.
October 1, 2018 / Eternal Team
As of May 2018 the population score of our world “Earth” has reached 7.6 billion. That means there are exactly 7.6 billion faces all around the world. This huge populace has resulted in various challenges and one of them is keeping track of each one.
Over the years many methods have been developed and tested to solve this issue. The advent of cloud technology is up-to its hills for solving this issue. The leader of cloud server technology AWS has come up with Amazon Rekognition to solve all of face matching issue. Eternal is an AWS partner and implements the latest Amazon technologies to solve custom software development needs. With Eternal and Amazon Rekognition you can get implemented face detection in your custom software in a snap (Just kidding :), it will take more time than snap).
Aws services that we have used
- Amazon Cognito
- Lambda Function
- Amazon Rekognition
- Amazon API Gateway
Purpose of the services
Amazon Rekognition Custom Labels
- S3 This services use to store image and search image.
- Amazon Rekognition This services use to detect faces. AWS rekognition compare two images ( faces in our case ) and co-related both faces in terms of various co-ordinates and generate result json.
- Lambda Function This function use to upload image in S3 and other use to compare faces.
- Amazon Cognito This services provides authentication, authorization, and user management for your web and mobile apps.it’s provides to pool id then use it web application.
- Amazon API Gateway This services use to get search results ( image ) and display images to web browser using lambda function.
What you can do
Amazon Rekognition Image Size
First you create an album ( no of photos ) from which you would like to compare single photo. Say for example you have already database of 50 faces available in a single album, so first have to create album and upload no of photos.
After your photo database is ready, you can supply single photo with the face/faces and system will identified the faces from all photo album and give you no of photos with matched face/faces.
All the technical stuff begins here
Collection Amazon rekognization store information about detected faces in server side container which is called collection.
IndexFaces Index created for individual face.
SearchFaceByImaage Supply an Image ,It search & returns Similar faces from the Collection based on supplied reference image.
- Create an empty collection
- A collection must be create before calling inexFaces API
- Collection Names are case-sensitive
- A collection can store millions of faces
- Return list of collection IDs create in your account
1. Go to AWS console management to create a S3 becket and its permission. It’s important that s3 bucket has sufficient read write permission to perform operation.
a. Create s3 bucket.
b. Change policy.
c. Click on bucket policy to read and write operation
d. Click on CORS configuration to allow all REST method to any domain.
2. Go to AWS console management then go to lambda functions and create lambda function (Node js 6.10).
Below code generate collectionID when upload a photo on s3 bucket.
a. Add S3 bucket event.
b. S3 bucket name enter and event type select is Object Created.
c. Then select lambda function then wirte a code
(NOTE: change collectionName ,Bucket regions and lambda regions at same ,This bucket to store all image)
From above code, now photo album is ready with a collection. Again let me recall that collection is a collection of indexFaces. So now collection of photos are ready.
3. Supply photos for search.
Go To AWS console management then go to S3 bucket and create new backet to use Repository for search input images.
a. Click on created S3 bucket then click on Permission.
b. Click on bucket policy to read and write operation
c. Click on CORS configuration to allow all REST method to any domain.
4. Create Lambda function for compare and searching image from collection.
a. SearchImage(node js.6.10)
In the FaceTime app on your Mac, do one of the following to end a call: End an audio call: Click the End button in the notification. End a video call: Move the pointer over the call window, then click the End Call button (or use the Touch Bar). After you end a Group FaceTime call, it remains active until all participants leave the call. On the iPhone, a user can activate FaceTime during a phone call by pressing the FaceTime button or initiated FaceTime from their call history or the Contacts application. IOS 7 and newer also provide a separate FaceTime app, as there always has been on Apple's non-telephony devices: iPad, iPod Touch, and Mac. Jul 31, 2020 FaceTime can also be initiated through the Contacts app by selecting a contact and choosing the FaceTime option, or through the Messages app by tapping on a person's name in an iMessage thread. Facetime app for macbook pro download.
5. Create an API in Amazon API Gateway.API exposing ‘your lambda function’ to clients.
6. Create html page.
(Note change poolid for IdentityPoolId insert your poolid ,and change bucket name change url (var url =’’) insert your apiGetWay url and change (imageurl)
Amazon face rekognization and face matching functions are ready to use.