A Face Detection and Recognition Model using Machine Learning.

Shristi Agarwal
2 min readSep 8, 2021

--

In this article I will share that how we detect and recognize the human face , and for that I will use frontal face haarcascade for the detection of the face, and for the face recognition I have used LBPHFaceRecognition for the Recognition of the face.

So, first loaded the haarcascade frontal face model through cv2.CascadeClassifier().

Then collect the Sample photos of the face…

Collected all the sample images….

After Collecting the sample images for the dataset lets initialize and train the model using cv2.face.LBPHFaceRecognizer_create() and train() function.

So, for testing, first I am checking with no face.

Now let’s test with the face …

And it’s predicting the face…

After predicting the face, the program will send a WhatsApp message using the pywhatkit module by it’s function pywhatkit.sendwhatmsg()

Using this module the web.whatsapp.com will open automatically, message will be typed automatically in the message box and send to the desired user.

So, that’s about this model

Thanks for the read….

Happy Learning🙃…

--

--