GithubHelp home page GithubHelp logo

mangipudiprashanth7 / facial-expression-recognition-using-deep-learning Goto Github PK

View Code? Open in Web Editor NEW
8.0 2.0 8.0 163.19 MB

License: MIT License

Jupyter Notebook 97.42% Python 2.58%
deep-neural-networks cnn-model opencv python3 facial-expression-recognition

facial-expression-recognition-using-deep-learning's Introduction

Kaggle Python 3.7TensorflowstackoverflowGithub

Facial Expressions Recognition using Convolutional Neural Networks

Branches:

  • master : Contains files related to training the model and realtime testing.
  • deployment : Contains files related to deployment of the deep learning model on web using flask micro framework.
  • Either clone the repo or download the Zip file based on your need, and start working.

Description:

  • fer2013.csv.zip - This is the dataset I've used. Do extract that on to your local system.
  • Facial Expression Detection (csv) - This notebook contains the implementation of Convolutional Neural Networks using fer2013.csv dataset directly.
  • Facial Expression Detection (dir) - This notebook contains the implementation of Convolutional Neural Networks using fer2013.csv dataset using Datagenerator Class of Keras after splitting the csv dataset to directories. The code for converting the fer2013.csv file to directories is in convertodir.py
  • model_weights.h5 & model.json - These weights file and architecture file as json are generated after training the CNN model in Facial Expression Detection (dir) notebook.
  • model_filter.h5 & fer.json - These weights file and architecture file as json are generated after training the CNN model in Facial Expression Detection (csv) notebook.

Dependencies:

  • Python=3.7
  • Tensorflow>=2.1
  • opencv>=4.0.1
  • keras>=2.3.1

Installation of dependencies using Anaconda distribution

  • Create a new virtual environment using conda

    conda create -n faceexpressions python=3.7 -y
  • Activating our new virtual environment

    conda activate faceexpressions
  • Installing necessary libraries

    pip install ipykernel
  • I'd recommend you to use the display name same as environment name

    python -m ipykernel install --user --name faceexpressions --display-name "faceexpressions"
  • If you have want to install Tensorflow GPU then use below command

    conda install tensorflow-gpu==2.0.0
  • If you have want to install Tensorflow CPU then use below command

    conda install tensorflow==2.0.0
  • The below pip command installs keras, opencv, pandas, matplotlib, scikit-learn

    pip install keras opencv-contrib-python pandas numpy matplotlib scikit-learn
  • The below command install jupyter notebook on Anaconda Distribution

    conda install jupyter
  • Once your dependencies installation is done, you can run the notebook files on jupyter notebook(if you are using Anaconda) using below command.

    jupyter notebook

Real-Time Testing of our model:

  • This can be done just by running RealtimePredictions.py

    python RealtimePredictions.py
  • You'll see a window pop up and you can find the predictions on your screen(I've cropped the window). (See the demo file below)

GIF

Result :

  • The architechture that I've built is very pretty simple, and I was able to get an validation accuracy of around 60.25 and training accuracy around 85.25.
  • The accuracy can still be improved by tuning the hyperparameters of the model. We can even make this more accurate by also using Transfer Learning.
Badges Copyright-MIT © aleen42

facial-expression-recognition-using-deep-learning's People

Contributors

nizam19 avatar prashanthm07 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.