Skip to content

nicodecastro/facial-expression-recognition

Repository files navigation

Facial Expression Recognition

This project aims to classify emotions from facial expressions using Keras and OpenCV in Python. The target emotions to be classified are happiness, sadness, anger, surprise, disgust, fear, and neutral.

Dataset

The project uses the FER-2013 dataset downloaded from Kaggle.

Methodology

Libraries

The libraries used for the project are as follows:

  • OpenCV (computer vision)
  • NumPy (numerical operations)
  • TensorFlow and Keras (deep learning)
  • dlib (optional: facial landmark detection)

Deliverables

Getting Started

Setting up your virtual environment:

  1. Create your virtual environment using the command:
python -m venv venv
  • Notes: You are not limited to using venv as the name for you virtual environment. Don't forget to include the directory in your .gitignore when using git.
  1. In the project directory, run the command:
.\venv\Scripts\activate
  • When using powershell and an error appears about scripts being disabled on your system, run either of the following commands instead:
Set-ExecutionPolicy Unrestricted -Scope Process
.\venv\Scripts\activate
Set-ExecutionPolicy Default -Scope Process

or

get-ExecutionPolicy
Set-ExecutionPolicy Unrestricted -Force
.\venv\Scripts\activate
Set-ExecutionPolicy <get-ExecutionPolicy result> -Force
  1. To ensure your virtual environment is activated, you may do the following:

    • Check for the (venv) prefix before your directory in the terminal
    • Check if there is a python path in your virtual environment directory in the terminal using where python or where.exe python in powershell
  2. With your virtual environment activated, install the required dependencies using the following command in your terminal:

pip install -r requirements.txt
  1. When generating your requirements.txt, simply copy the results of the command below:
pip freeze

<# Sample Results with pytz and requests packages installed

certifi==2024.6.2
charset-normalizer==3.3.2
idna==3.7
pytz==2024.1
requests==2.32.3
urllib3==2.2.1

#>
  1. When you are done using the virtual environment, deactivate it using the following command in your terminal:
deactivate

Contributing

License

References

This section lists resources that were helpful in the development of this project or provide further reading on the topic.

About

Facial emotion classification using Keras and OpenCV

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages