Facial Expression Recognition

About

This project is made by convolutional neural network (CNN) in Keras from scratch to recognize facial expressions. The data consists of 48x48 pixel grayscale images of faces. The objective is to classify each face based on the emotion shown in the facial expression into one of seven categories using OpenCV to automatically detect faces in images and draw bounding boxes around them.

Technologies

Technologies

What is OpenCV?

OpenCV (Open Source Computer Vision Library) is an open-source computer vision and machine learning software library. OpenCV was built to provide a common infrastructure for computer vision applications and to accelerate the use of machine perception in commercial products. Right now, OpenCV supports a lot of algorithms related to Computer Vision and Machine Learning and it is expanding day-by-day. OpenCV is a huge library. One can get lost while reading specific feature documentation and its implementation. So, the repository aims to have a minimal implementation of all OpenCV features together, under one roof. OpenCV-Python is the Python API of OpenCV. It combines the best qualities of OpenCV C++ API and Python language.

What is DeepFace?

DeepFace is a Facebook research group's deep learning facial recognition technology. In digital photos, it recognizes human faces. The software was trained on four million photographs shared by Facebook users and uses a nine-layer neural network with approximately 120 million connection weights. In the Labeled Faces in the Wild (LFW) data set, where human humans have 97.53 percent accuracy, the DeepFace approach achieves an accuracy of 97.35 percent 0.25 percent, according to the Facebook Research team. DeepFace, as a result, is sometimes more successful than humans.

Important Libraries

Tensorflow

TensorFlow is a Google-developed open-source library for deep learning applications. Conventional machine learning is also supported. TensorFlow was originally designed for complex numerical computations rather than deep learning. However, it proved to be quite valuable for deep learning development, so Google made it open-source.

Flask

Flask is a web framework and a Python module that makes it simple to create web applications. It's a microframework without an ORM (Object Relational Manager) or other features, thus it's small and easy to modify. It has a lot of cool features, such as url routing and a template engine. It's a web application framework that uses the WSGI protocol.

Getting Started 👨‍💻

Local setup

  1. fork the repository - Creates a replica of repository to your local environment.
  2. Clone the repository using git clone https://github.com/NikkiPriya/Project-Exp-Recog - Downloads all repo files to your machine.
  3. cd Project-Exp-Recog - Takes you to the root directory of the project.

Environment setup

Once you have done with local setup, make sure to install dependencies using pipenv with the provided pipfile and execute all commands using pipenv. Also, please make sure to add the correct path to the video file in camera.py on line 11. Next, to install pipenv, the dependencies, and run the main.py file, execute the following commands from your command prompt, make sure to add the right paths where necessary:

cd \path\to\Project-Exp-Recog\
pip install pipenv
pipenv install
pipenv run python3 main.py

Now you are ready to contribute :)

How to contribute to Facial Expression Recognition project?

Step 1. Find an issue

  • Take a look at the Existing Issues or create your own Issues!
  • Wait for the Issue to be assigned to you after which you can start working on it.
  • Note : Every change in this project should/must have an associated issue.

Step 2. Create a copy of this repository

  • Follow the guidlines given in local setup.

Step 3: Creating a new branch

  • Create a new branch. Use its name to identify the issue your addressing.
  • It is important to branch the repository so that you can manage the workflow, isolate your code, and control what features make it back to the main branch of the project repository.

When creating a branch, you must create your new branch off of the master branch. To create a new branch, from your terminal window, follow:

git branch new-branch
git checkout new-branch

Once you enter the git checkout command, you will receive the following output:

Switched to branch 'new-branch'

Step 4: Contribution:

  • Work on the issue(s) assigned to you.
  • Add all the files/folders needed.

Step 5: Commiting and Pushing:

Once you have modified an existing file or added a new file to the project, you can add it to your local repository, which we can do with the git add command.

git add filename or git add .

You can type the command git add -A or alternatively git add -all for all new files to be staged.

With our file staged, we’ll want to record the changes that we made to the repository with the git commit command.

The commit message is an important aspect of your code contribution; it helps the other contributors fully understand the change you have made, why you made it, and how significant it is.

git commit -m "commit message"

At this point you can use the git push command to push the changes to the current branch of your forked repository:

git push --set-upstream origin new-branch

Step 6: Create Pull Request

  • At this point, you are ready to make a pull request to the original repository.

  • You should navigate to your forked repository, and press the “Compare & pull request” button on the page. PR Git

  • Add a title and description to your pull request that explains your contribution.

  • Create a Pull Request which will be reviewed and suggestions would be added to improve it.

  • Add Screenshots to help us know what this enhancement/implementation is all about.

  • Press the “Create pull request” button.

create pr

Your Pull Request has been submitted and will be reviewed by the maintainer and merged.

Step 6: Congratulations

You have made your contribution to this project!


For any more issues and queries, please connect with me

Skill Skill feel free to reach out.

**Rememeber, collaboration is the key to open-source** 🌟✨