Using Face Recognition for automation

Using Face Recognition for automation

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.

No alt text provided for this image

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 ->

No alt text provided for this image

Model training ->

No alt text provided for this image

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 ->

No alt text provided for this image

face_detector is a function that is called later in a loop, for getting image coordinates.

No alt text provided for this image

Now once the face is a detected we can take further actions!

No alt text provided for this image

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 ->

No alt text provided for this image

in the first argument of sendwhatmsg use the phone number with country code!

Code to do Mail ->

No alt text provided for this image
No alt text provided for this image

Terraform code ->

No alt text provided for this image


Amit Sharma

CKA || 1xAWS || 4xGCP || 1xAzure || 2xRedHat Certified || DevOps Engineer [???????]@Searce Inc || Freelancer || Terraform || Ansible || GitLab || Jenkins || Kubernetes || Docker || Openshift || AWS || GCP || Azure

3 年

?????????? nice one

Tejas Gupta

Building PW??★AWS Community Builder ★ Public Speaker ★ AWS/Azure/Redhat Certified ★Cloud & DevOps Engineer ★ AWS UG Mumbai ★ Content Creator

3 年

Good work

Divya Jain

SRE at PocketFM || Microsoft Learn Student Ambassador||2??coder at codechef || Aspiring Mlops Engineer||Devops||Machine-Learning

3 年

Nice!

要查看或添加评论,请登录

Yash Indane的更多文章

  • Use of K-mean clustering in security domain

    Use of K-mean clustering in security domain

    Summer Task-10 & ARTH Task 42 Github -> What is K-means Clustering? K-means clustering is one of the simplest and…

  • OSPF Routing Protocol using Dijkastra Algorithm

    OSPF Routing Protocol using Dijkastra Algorithm

    What is OSPF? The OSPF (Open Shortest Path First) protocol is one of a family of IP Routing protocols, and is an…

  • JavaScript use cases in Industry

    JavaScript use cases in Industry

    Summer Task 7.2 What is JavaScript? JavaScript, often abbreviated as JS, is a programming language that conforms to the…

    1 条评论
  • Use of confusion matrix in detecting cyber crime

    Use of confusion matrix in detecting cyber crime

    Summer 2021 Task 05 ??????? Particularly in the last decade, Internet usage has been growing rapidly. However, as the…

  • Running Chrome in Docker container

    Running Chrome in Docker container

    Summer - Task 02 ??????? By default containers don't support GUI, but by some way we can achieve that, let's discuss…

    3 条评论
  • Training a ML model inside a container

    Training a ML model inside a container

    Task 01 ??????? Task Description ?? ?? Pull the Docker container image of CentOS image from DockerHub and create a new…

    4 条评论
  • Deploying WordPress in Amazon EKS with RDS in Backend

    Deploying WordPress in Amazon EKS with RDS in Backend

    ARTH-TASK-23 WordPress is a free and open-source content management system written in PHP and paired with a MySQL or…

    3 条评论
  • How industry uses MongoDB

    How industry uses MongoDB

    ARTH-TASK-32 What is MongoDB? MongoDB is a source-available cross-platform document-oriented database program…

  • Creating a Multicloud Setup of Kubernetes using Ansible Roles

    Creating a Multicloud Setup of Kubernetes using Ansible Roles

    TASK 28 Task Description ?? ?? CREATE A MULTI-CLOUD SETUP of K8S cluster: ?? Lunch node in AWS ?? Lunch node in Azure…

    2 条评论
  • Helm and Charts in Kubernetes

    Helm and Charts in Kubernetes

    ARTH TASK 24 What are Charts ? A chart is a collection of files that describe a related set of Kubernetes resources. A…

社区洞察

其他会员也浏览了