Download Fer2013 dataset if training of the model is being executed and create a folder with the name data in the main folder and place the fer2013 folder in the data folder-
- [Kaggle Fer2013 challenge](https://www.kaggle.com/c/challenges-in-representation-learning-facial-expression-recognition-challenge/data)
#For SVM
-
Download model, unzip and place in the SVM folder
-
Install dependencies
pip install numpy pip install argparse pip install sklearn pip install scikit-image pip install pandas pip install hyperopt pip install dlib
-
Convert the dataset to extract Face Landmarks and HOG Features
python convert_fer2013_to_images_and_landmarks.py
-
Train the model
python train.py --train=yes
-
Evaluate the model
python train.py --evaluate=yes
-
Train and evaluate [instead of step 5 and 6]
python train.py --train=yes --evaluate=yes
-
Customize the training parameters:
Feel free to change the values of the parameters in the
parameters.py
file accordingly. -
Find the best hyperparameters (using hyperopt):
python optimize_parameters.py --max_evals=15
-
Install Dependencies
- TensorFlow (latest version) Installation
- OpenCV (python3-version) Installation
-
To run the demo, just type:
python3 main.py
Then the program will creat a window to display the scene capture by webcamera. You need press SPACE key to capture face in current frame and recognize the facial expression.
- To train models
Modifying the
MODE
(inmain.py
) fromdemo
totrain
before you start training. Then type:python3 main.py