Send out whatsapp message, email and launch ec2 instance with ebs volume in AWS upon detecting face

Dharmika D
3 min readJun 22, 2021

🤔Thinking about the innovative world where all humans are going to be replaced by robots 🤖, first thought that strikes would be of automated devices that would perform every task. How are these automatic task performing models are made? Getting down to brass tacks….

Hello everybody!!😊

I came up with an interesting piece of work that would give an idea of the working of these computerized models. In this blog I would like to demonstrate how to send a Whatsapp message📞, email 📟 when a face is detected.

Technologies and libraries that I used for this project are:

☘ Computer Vision ☘ Python(coding) ☘ AWS cloud console ☘ pywhatkit (whatsapp messages) ☘ mailer (sending mails) ☘ OS module and time module for setting up instance.

Cutting to the chase….😁

💢 STEP : 1

— Run => aws configure

then provide your access key, secret key, region name which available in AWS console.

configuring aws

STEP : 2

Put down the code…

*code accessible from my GitHub : https://github.com/Dharmika228/FaceDetection

STEP : 3

Run the first cell to collect sample data

output while collecting sample data
sample data collected

STEP 4: Run second cell

Training the model with the dataset.

For training the model, I used Local Binary Patterns Histograms (LBPH) algorithm.

Training the model
model trained

STEP : 5 Run next cell

A window will open where in the model gets accessed to webcam and recognises the face that is trained to it. After recognizing it would send message to whatsapp and email provided.

recognizing the face that is trained to model
whatsapp message sent
mail sent

STEP : 6 — Again run the same cell, it launch ec2 instance with ebs volume attached for different face recognized.

instance launched
ebs volume attached to the instance

Hope you find my blog erudite!! Thank you 😊

--

--