AI/ML, AWS, Cloud Computing

4 Mins Read

Amazon Rekognition: Cloud-based AI Image and Video Analysis for Detecting Faces

Voiced by Amazon Polly

Introduction

Amazon Rekognition is a cloud-based AI service provided by AWS which utilizes deep learning technology to analyze the images and videos stored in Amazon S3. It can analyze images and videos for detecting objects, detecting faces, comparing the faces on an image or video, detecting unsafe objects in an image or video, search faces by image and sentiment analysis.

Pioneers in Cloud Consulting & Migration Services

  • Reduced infrastructural costs
  • Accelerated application deployment
Get Started

Detect Faces API in Amazon Rekognition

Detect Faces API is used to recognize the faces on images and videos, which helps to compare the faces and determine the number of images containing duplicate faces in an image. It is also useful for user verification by registering the faces in a collection and uses facial authentication.

This API provides the response where we will get the number of faces and their attributes like gender, age, beard, smile, sunglasses, eyeglasses, eyes open, mouth open, emotions, and hair. Also, face detection API provides information about pose, quality, and eye direction. Finally, confidence is about all the attributes of a face based on the percentage detected in an image.

This system helps predict whether a face exists in an image or not. The main critical component of face detection is Confidence scores which give the final result by comparing the percentages of all the attributes of a face, and users should consider this component confidence score which helps to make decisions based on the system’s output.

Detecting the Faces on an Image stored in Amazon S3

Now, we will analyze the image below using Detect Faces API on an image in Amazon S3 and find below the sample code of Python and its response.

face

The below sample code is for performing the Detecting Faces API on an image stored in an Amazon S3 bucket:

Sample Response of Detect Faces API on Images and Its Attributes

By default, we will be getting all the attributes of a face present in an image because we have mentioned ALL of the Attributes in the above code. The face detection API response will have all the below keys in each face object with two keys: value and confidence, with their Boolean values and percentage of confidence. Below are the parameters which we are getting in this scenario.

face2

face3

face4

Detecting the Faces on a Video stored in Amazon S3

It’s also possible to use Detect Faces API on video, but before calling the API on a video, we need to pass the JobID, which will get generated from the start_face_detection API. The code below is for calling the detect faces API on a video.

Get_face_detection API will provide the array of faces, which contains information about the number of faces detected in the video and attributes which comes in response mentioned below.

This API provides the information about

  • The location of the faces detected in the video frame at a time.
  • Number of faces detected in the video.
  • The position of the eyes was detected in the video.

The below sample code is for performing the Detecting Faces API on a video stored in an Amazon S3 bucket:

The above code provides the response having all attributes we have in the above Detect Faces API response on Image except these two FaceOccluded and EyeDirection attributes.

Use cases of Amazon Rekognition Service

  • Facial Detection and Analysis
  • Moderating the inappropriate content in both images and videos
  • Detecting the objects
  • Comparing the faces present in images and videos

Conclusion

Amazon Rekognition is a powerful AI service that uses deep learning algorithms, offering various use cases for image and video analysis.

It can analyze any use case, like detecting faces, detecting labels, recognizing celebrities, detecting inappropriate objects, searching the faces on an image, and more.

Drop a query if you have any questions regarding Amazon Rekognition and we will get back to you quickly.

Making IT Networks Enterprise-ready – Cloud Management Services

  • Accelerated cloud migration
  • End-to-end view of the cloud environment
Get Started

About CloudThat

CloudThat is an official AWS (Amazon Web Services) Advanced Consulting Partner and Training partner and Microsoft Gold Partner, helping people develop knowledge of the cloud and help their businesses aim for higher goals using best in industry cloud computing practices and expertise. We are on a mission to build a robust cloud computing ecosystem by disseminating knowledge on technological intricacies within the cloud space. Our blogs, webinars, case studies, and white papers enable all the stakeholders in the cloud computing sphere.

To get started, go through our Consultancy page and Managed Services Package that is CloudThat’s offerings.

FAQs

1. Is Amazon Rekognition service suitable for real-time analysis?

ANS: – Yes, it’s suitable for performing this service on real-time analysis for applications requiring immediate video insight.

2. What about the pricing of this service?

ANS: – It follows a pay-as-you-go pricing model, and it depends on the number of API calls on images and videos.

WRITTEN BY Sridhar Andavarapu

Sridhar works as a Research Associate at CloudThat. He is highly skilled in both frontend and backend with good practical knowledge of various skills like Python, Azure Services, AWS Services, and ReactJS. Sridhar is interested in sharing his knowledge with others for improving their skills too.

Share

Comments

    Click to Comment

Get The Most Out Of Us

Our support doesn't end here. We have monthly newsletters, study guides, practice questions, and more to assist you in upgrading your cloud career. Subscribe to get them all!