Using Face Recognition for automation
Yash Indane
Tech Enthusiast | Integrating Technologies | 1x AWS Certified | 6x Microsoft Certified | Cloud Computing | DevOps
SUMMER-TASK-6 (Team Task) and ARTH TASK 38
GitHub ->
In this article I will explain how we can use Face Recognition and then send the mail and whatsapp message. Further if other face detected then we create EC2 instance in AWS!
For Face detection we are using LBPH algorithm
What is LBPH algorithm?
The Local Binary Pattern Histogram(LBPH) algorithm is a simple solution on face recognition problem, which can recognize both front face and side face. The gray value of the pixel is replaced by the median value of its neighborhood sampling value, and then the feature value is extracted by the sub blocks and the statistical histogram is established.
As we have an image in grayscale, each histogram (from each grid) will contain only 256 positions (0~255) representing the occurrences of each pixel intensity.
Then, we need to concatenate each histogram to create a new and bigger histogram. Supposing we have 8x8 grids, we will have 8x8x256=16.384 positions in the final histogram. The final histogram represents the characteristics of the image original image.
Let's create a LBPH model using Python
Collecting Dataset ->
Model training ->
The LBPH model is trained by using face_LBPHFaceRecognition.create() from cv2.
we need opencv-contrib-python so install by ->
pip install opencv-contrib-python
Main Face Recognition Code ->
face_detector is a function that is called later in a loop, for getting image coordinates.
Now once the face is a detected we can take further actions!
Here the a is a variable acting as a switch variable to trigger the automation when the trained face is a detected.
Code to do whatsapp message ->
in the first argument of sendwhatmsg use the phone number with country code!
Code to do Mail ->
Terraform code ->
CKA || 1xAWS || 4xGCP || 1xAzure || 2xRedHat Certified || DevOps Engineer [???????]@Searce Inc || Freelancer || Terraform || Ansible || GitLab || Jenkins || Kubernetes || Docker || Openshift || AWS || GCP || Azure
3 年?????????? nice one
Building PW??★AWS Community Builder ★ Public Speaker ★ AWS/Azure/Redhat Certified ★Cloud & DevOps Engineer ★ AWS UG Mumbai ★ Content Creator
3 年Good work
SRE at PocketFM || Microsoft Learn Student Ambassador||2??coder at codechef || Aspiring Mlops Engineer||Devops||Machine-Learning
3 年Nice!