Face Recognition using OpenCV
Experiment 1 result

Face Recognition using OpenCV

After my post, on Mask NoMask, I thought of applying Face Recognition on both images and live video streams as next step towards UnLock 1.0

I learnt about how deep learning is applied to detect faces, compute 128-d face embedding that quantify each face in an image, how we can train the models to learn those embedding and then recognize the faces in images and video streams. The Triplet Loss function and how distances are measured between different faces (w.r.t the difference in length of eyes, nose, lips, chin etc), to finally recognize a person present in a image. Initially HOG( Histogram of Gradients) was used as underlying model to learn faces but with advancement of deep learning, CNN has taken over show. 

Here is my little exploration around cnn based face recognition, using OpenCV, dlib, and python3.

Experiment 1: I just gave 2 images of 3 persons and allowed it to find embedding and saw if this algorithm can detect faces as well as recognize them right!! (results attached) . To make it more difficult I passed images with group of people in it, instead of single random images of persons I have trained and it did detect all faces in frame and recognize those I trained. I kept the tolerance to 0.6 and programmed to say all detected faces if not known to still show "Unknown" else the name of person I have given. (Attached screenshot)

No alt text provided for this image

Experiment 2 : This time I passed 1 image for each of 6 persons to this model and allowed it embed them and see if it still detects and recognizes them right!! I had to hyper tune the tolerance to 0.5 and 0.6 to see difference in result.(Attached screenshot)

No alt text provided for this image

The same can easily be extended to recognize on web cam stream/ video too.

Face recognition is not only used to identify/verify a person but also could be used for things like Automatically organizing raw photos libraries by person, tracking a specific person , counting unique people, finding people with similar appearances, etc.

Happy Learning !!

Wow a step towards excellence 👍🏻

This course is also referred to immigration officers in India ,nice Kudos 😊

Great job, Rashmi! Keep it rolling. :) Waiting for more posts. One thing that I can say is, the world is moving very fast!

To view or add a comment, sign in

More articles by Rashmi Tomer

Others also viewed

Explore content categories