DEV Community

Cover image for Detect, Analyze and Compare faces using Amazon Rekognition
Olawale Adepoju for AWS Community Builders

Posted on • Originally published at dev.classmethod.jp

Detect, Analyze and Compare faces using Amazon Rekognition

Introduction

In this blog post, I will be showing a demo on the AWS management console on how to the face recognition features in Amazon Rekognition. I will analyze an image with Amazon Rekognition and then compare it to other images to check if the faces are the same.

What is Amazon Rekognition?

Amazon Rekognition is a deep learning-based image and video analysis service. If you are implementing an employee verification system, need to automate video editing, or provide secondary authentication for other applications, you may encounter the difficulty of facial recognition and comparison. You could fix this by creating your own machine learning model, an API, and managing your own infrastructure. This approach is costly, time-consuming, and needs specialized understanding.

An easier method is to utilize Amazon Rekognition, which can recognize faces in images or videos, discover facial landmarks like as eye location, and detect emotions such as joy or sadness in near-real time or in batches without infrastructure or modeling maintenance.

Open the AWS Management Console, then type Rekognition in the search bar.

Image description

Analyze Faces

To start, select Facial analysis in the panel navigation on the left. This feature allows you to analyze faces in an image and receive a JSON response.

Image description

  • Open and save the first sample image for this tutorial here.

NOTE: For the reasons of copyright, we will be using images from the AWS sample and not random images online.

  • Click the Upload button and select the sample image you just saved.

  • To the right side of the facial analysis, you can see the quick result for each face detected.

Image description

Compare Faces

In this stage, you'll utilize the face comparison feature to get the detailed JSON result from comparing two unrelated photographs.

Select Face Comparison on the left panel.

Image description

  • Open and save the second sample image for this tutorial here.

  • Click on the Upload button for the reference face and select the image you just saved.

Image description

Image description

  • To view the JSON results, select the Response dropdown menu. It is worth noting that the "Similarity" score for each of the identified faces is never more than 1.

Image description

Compare Faces Again

In this phase, you'll use the face comparison feature to get the detailed JSON result from comparing two photographs that match.

  • Open and save the third and final sample image for this tutorial here

Image description

  • Take note that the reference face that matched our other photo had a 99% similarity score and determined that none of the other faces was a match.

Image description

  • Click on the Response dropdown to see the details of each comparison.

Image description

Top comments (0)