Detecting the emotion of human with the help of computer vision to distinguish between 5 types of emotion (anger, happy, sad, surprise, unknown). Used an convolutional neural network model (CNN) inspired from VGG-16 model architecture.
The model has been trained on fer2013 dataset and got 60 percent in Google Colabaratory's GPU so it may not be accurate but performs well. you are welcome to train it more.
Python-3
Tensorflow
Opencv
We can set this project in your local machine to start predicting.
Open a terminal, clone the Emotion_Detection repository and go into the directory using the command cd.
git clone https://github.com/sherwin7/Emotion_Detection.git
cd Emotion_DetectionCheck python-3 is installed then install pip manager for python-3 and install virtual environment.
#Checking python is installed
python3 --version
#Installing pip manager
sudo apt install python3-pip
#Checking pip is installed for python3
pip3 --version
#Installing virtual environment
sudo pip3 install virtualenvSetting up virtual environment.
#Creating virtual environment
virtualenv -p python3 venv
#Activating the virtual environment venv
source venv/bin/activateNow we have to install all the dependencies using pip in our virtual environment from requirements.txt.
Check requirements.txt to know what are all the dependencies used.
pip install -r requirements.txtWe can run the emotion_detection.py. Here the video used are in test_videos you can keep yours and try or if you want to use a live video from your webcam In emotion_detection.py change the line 31 (i.e) cap = cv2.VideoCapture('./test_videos/test3.mp4')to cap = cv2.VideoCapture('0') which takes the default camera as input and press q to quit from the program.
python emotion_detection.py

