Download the fer2013 dataset from kaggle:
unzip it to get the csv file copy it to the data folder.
This project was done on python version 3.6
Create a conda environment and install the required packages with the following commands:
- conda create --name emotions-recognition --file emotions-recognition.txt
OR try your luck manually:
-
conda create --name emotions-recognition
-
activate emotions-recognition
-
conda install opencv pandas pytables matplotlib keras scikit-learn tensorflow ipykernel pillow graphviz pydotplus
-
pip install keras-vis
Finally:
A) Install graphviz from http://www.graphviz.org/ and add its bin folder to PATH (this step is needed only to visualize the resulting CNN layers as a graph)
-
Run the "Import Data" jupyter notebook first to clean the data and create a fer2013.h5 file
-
Run the "NN_model" jupyter notebook to train the neural network model and create a keras_model.h5 file
-
Run the "feature_visualization" jupyter notebook to see some examples of predictions and see important pixels used by the CNN for the prediction.
-
Run the "Camera" jupyter notebook to start the camera and see the prediction of the trained model