Face Recognition


Task Description πŸ“„

❄️ Create a program that perform below mentioned task upon recognizing a particular face. 

πŸ“Œ When it recognize your face then - 

πŸ‘‰ It send mail to your mail id by writing this is face of your_name. 

πŸ‘‰ Second it send whatsapp message to your friend, it can be anything. 

πŸ“Œ When it recognize second  face, it can be your friend or family members face.

πŸ‘‰ Create EC2 instance in the AWS using CLI. 

πŸ‘‰ Create 5 GB EBS volume and attach it to the instance. 

Step 1:- Let's get started with this task. For the model to recognise a face it should first get trained and for training a model we require a dataset. So our basic requirement is to create a dataset. For that we need a face classifier which will detect the coordinates of face. Here we are going to use haarcascade_frontalface_default.xml  classifier. For creating a dataset we are going to collect 100 samples of face and resize them to a fixed size and store in a folder. Path of that folder where the samples are to be collected is provided in file_name_path .




Step 2:- Now we will train our model by using LBPHfacerecognizer


Model trained successfully!!!

Step 3:-Next we have to send email when the face is recognised and confidence score is greator than 70 .You can take any confidence score. Here we are using smtplib module. The smtplib module defines an SMTP client session object that can be used to send mail to any Internet machine. For that you have to allow the access for less secure apps in settings of your gmail account.


as you can see in above program that we have defined email function.In this function in server.login you have to provide your email address and password and in server.sendmail you have to provide the email address of person whom you want to send the mail.

As we have created function of email similarly we have created for whatsapp and for sending message to someone on whatsapp I have used 'pywhatkit'  module.



Step 4 :- In this step when the face is not yours it may be your family member of friend's face then the program should perform the below operations:-

Create EC2 instance in the AWS using CLI. 

Create 5 GB EBS volume and attach it to the instance.

For this code you must have to download AWS-CLI in your system.

 For launching EC2 instance

"aws ec2 run-instances --image-id  <<ami-011c99152163a87ae>> --count 1 --instance-type t2.micro --key-name <<AWSkey>> --security-group-ids <<sg-61c4031d>> --subnet-id <<subnet-0fb84c64>>"

For creating a 5 GB EBS volume 

"aws ec2 create-volume --volume-type gp2 --size 5 --availability-zone ap-south-1a"

For attaching instance to this volume

"aws ec2 attach-volume --volume-id <<vol-02aeff71c4a3d2b9a>> --instance-id <<i-09e04db71d14e0d16>> --device <</dev/sdf>>"


Thank you for visiting my blog πŸ˜Š














































Comments

Post a Comment