Wednesday, January 10, 2018

Using OpenCV to detect Faces and Smiles

As a part of a larger course on Computer Vision, I was exposed to some nifty applications of OpenCV. I was provided a pre-trained model which could identify faces and eyes, and was tasked with developing a way to detect smiles as an exercise.

After only a few lines of code, we are able to utilize the webcam and give the application a shot! With matplotlib, we are able to visualize the model in action.


With one simple edit, we are able to detect smiles, which really only detects the change in what the model sees as a "mouth" and matches the dimensions of the detected area to its pre-trained categorization for "smile".


The result is definitely enough to make you smile!


If you want to give this a shot, the Jupyter notebook is embedded below, as well as a link to the source code.


This is the first part of a Udemy Computer Vision course that I completed. The link to the github can be found here:

https://github.com/SLPeoples/Deep-Learning-and-Computer-Vision

No comments:

Post a Comment