Detecting emotions in real time
At its most basic form, a video is just a series of images. By leveraging this seemingly simple or trivial fact, we can adapt what we know about image classification to create very interesting video processing pipelines powered by deep learning.
In this recipe, we'll build an algorithm to detect emotions in real time (webcam streaming) or from video files. Pretty interesting, right?
Let's begin.
Getting ready
First, we must install several external libraries, such as OpenCV
and imutils
. Execute the following command to install them:
$> pip install opencv-contrib-python imutils
To train an emotion classifier network, we'll use the dataset from the Kaggle competition Challenges in Representation Learning: Facial Expression Recognition Challenge, which is available here: https://www.kaggle.com/c/challenges-in-representation-learning-facial-expression-recognition-challenge/data. You must sign in or sign up in order to...