Prompting operations using Face Detection

Hello readers,

In this blog, I have explained how to prompt system to perform below mentioned operations on detecting a face:

When it recognizes my face it will:

send a mail to my mail id.
send a WhatsApp message to the specified contact.

When it recognizes a second face, it will:

create an EC2 instance in the AWS using CLI.
create 5 GB EBS volume and attach it to the instance.

Step1:Configure AWS on Windows Command Prompt

Enter the following command in your windows command prompt:

aws configure

After running the above command we have to provide the following details:

Access_Key_ID

Secret_Key_ID

Region_Name

Format_JSON

Step 3:

First we will load Haarcascade Face recognition model and collect the training data by capturing 200 images using the Webcam to train our model. We also define function to convert the images to grayscale and crop the faces and save in a specified folder.

Step 4: Train Model

We load our training dataset and create numpy arrays for training data and labels. Furthermore, we initialize face recognizer and train the model.

STEP 5: Face Recognition and Prompting Specified Operations Accordingly

Now upon detecting my face it will send a WhatsApp message using WhatsApp web app and send an e-mail to specified mail address using PyWhatKit library of python. For this to happen the confidence score needs to be greater than 90%.

And if it detects the second face of any person like friend or family member, it will launch an EC2 instance in AWS, it will creates 5 GB EBS volume and attach it to the instance. The program will wait for 60 seconds i.e, 1minute before initiating the EBS block so that the EC2 instance is initialized and there are no errors while attaching.

OUTPUT:

Thank you for reading!

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Everything you need to know about MobileNetV3 and its comparison with previous versions

NeuroNuggets: An Overview of Deep Learning Frameworks

NeuroNuggets: CVPR 2018 in Review, Part I

The 6 Jars of Machine Learning

Mastering TensorFlow Tensors in 5 Easy Steps

NLP Zero to One: Knowledge Graphs Part(15/40)

How to Master Python for Machine Learning in 10 minutes by doing small projects

Master Python for Machine Learning

Decision Tree Regression

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Anjali Singh

Anjali Singh

More from Medium

How to Deploy an App Using Google Compute Engine

Getting started with Computer Vision AI / ML — Tutorial Step 3 of 7: Upload to Google Cloud…

Language Detection for Unstructured Data with AWS S3 Batch Operations and AWS Comprehend

Methods with Losses: JPEG2000 and JBIG2

Methods with Losses: JPEG2000 and JBIG2