October 12, 2018 / Nirav Shah
Face detection is the latest cutting-edge computer technology that is being used in a variety of applications to identify human faces in digital images and streaming videos. With the increase in IT and IP security organizations, face detection through live videos has become the industry standard for IT security firms.
Face detection and recognition has found its huge implementation in social media and a variety of other applications. In this blog post, we are going to talk about how you can get a super-accurate facial recognition enabled application in just a few hours, with a little investment, Eternal’s Amazon Video Rekognition expertise and some cups of coffee.
<h2><b>Aws Services</b></h2>
<ol class=”scaling”>
<li>S3</li>
<li>Amazon Cognito</li>
</ol>
<h2><b>Purpose Of The AWS Services</b></h2>
<ul class=”monitoring”>
<li><b>S3</b> This services use to store video.</li>
<li><b>Amazon Rekognition</b> This services use to analyze videos. AWS rekognition you can detect images ( faces in our case ) and generate result json.</li>
</ul>
<h2><b>What You Can Do With AWS Video Rekognition?</b></h2>
First you create an S3 bucket to upload an .mp4, .mov or .avi format video file to your S3 Bucket then using <strong>Amazon Rekognition</strong> video api.
All the technical stuff begins here
<h2><b>Create Collection</b></h2>
<ul class=”monitoring”>
<li>Create an empty collection</li>
<li>A collection must be create before calling inexFaces API</li>
<li>Collection Names are case-sensitive</li>
<li>A collection can store video</li>
</ul>
<img class=”img-responsive” src=”https://www.eternalsoftsolutions.com/blog/wp-content/uploads/2018/10/carbon1-1.png” />
<img class=”img-responsive” src=”https://www.eternalsoftsolutions.com/blog/wp-content/uploads/2018/10/Amazon_Video_Rekognition.jpg” />
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
<img class=”img-responsive” src=”https://www.eternalsoftsolutions.com/blog/wp-content/uploads/2018/10/1.png” />
d. Click on CORS configuration to allow all REST method to any domain.
<img class=”img-responsive” src=”https://www.eternalsoftsolutions.com/blog/wp-content/uploads/2018/10/2.png” />
2.Starts asynchronous detection of faces in a stored video.
Amazon Rekognition Video can detect faces in a video stored in an Amazon S3 bucket. Use Video to specify the bucket name and the filename of the video. StartFaceDetection returns a job identifier (JobId ) that you use to get the results of the operation. When face detection is finished, Amazon Rekognition Video publishes a completion status to the Amazon Simple Notification Service topic that you specify in NotificationChannel . To get the results of the label detection operation, first check that the status value published to the Amazon SNS topic is SUCCEEDED . If so, call and pass the job identifier (JobId ) from the initial call to StartFaceDetection .
<ul>
<li>create a Python script to return JobId</li>
</ul>
<img class=”img-responsive” src=”https://www.eternalsoftsolutions.com/blog/wp-content/uploads/2018/10/carbon2-1.png” />
3.Gets face detection results for a Amazon Rekognition Video analysis started by .
Face detection with Amazon Rekognition Video is an asynchronous operation. You start face detection by calling which returns a job identifier (JobId ). When the face detection operation finishes, Amazon Rekognition Video publishes a completion status to the Amazon Simple Notification Service topic registered in the initial call to StartFaceDetection . To get the results of the face detection operation . If so, call and pass the job identifier (JobId ) from the initial call to StartFaceDetection.
GetFaceDetection returns an array of detected faces (Faces ) sorted by the time the faces were detected.
Use MaxResults parameter to limit the number of labels returned. If there are more results than specified in MaxResults , the value of NextToken in the operation response contains a pagination token for getting the next set of results. To get the next page of results, call GetFaceDetection and populate the NextToken request parameter with the token value returned from the previous call to GetFaceDetection .
create a python script to detect Face
<img class=”img-responsive” src=”https://www.eternalsoftsolutions.com/blog/wp-content/uploads/2018/10/carbon3-1.png” />
<style type=”text/css”>
ol.scaling {padding-left: 0;margin-bottom: 30px;list-style-position: inside;}.scaling li {margin-bottom: 10px;}.scaling li img.img-responsive {margin: 30px auto;border: 1px solid;}ul.monitoring {padding-left:0;}.blog-portion-one ul.monitoring li {margin-bottom: 10px;list-style: outside !important;}.scaling li{font-size: 18px;line-height: 28px;}</style>
<b>Also Read:</b> <a href=”https://www.eternalsoftsolutions.com/blog/face-detection-and-matching-using-amazon-image-rekognition/”><span style=”font-weight: 400;”>AWS Rekognition: Face Detection, Comparing And Analysing</span></a>
<a href=”https://www.eternalsoftsolutions.com/aws-services/hire-aws-developer.php”><span style=”font-weight: 400;”>Hire Dedicated AWS Developers</span></a>

Nirav Shah is the Director of Eternal Web Pvt Ltd, an AWS Advanced Consulting Partner and certified Odoo Partner based in the UK. With over a decade of experience in cloud computing, digital transformation, and ERP implementation, Nirav helps enterprises adopt the right technology to solve complex business challenges. He specialises in AWS infrastructure, Odoo ERP, and web development solutions for businesses across the UK and beyond.
Have queries about your project idea or concept? Please drop in your project details to discuss with our AWS Global Cloud Infrastructure service specialists and consultants.