Skip to content

Using Transfer-learning and fine-tuning multiple models (Mobilenetv2, VGG, and building a CNN model from scratch) and comparing results to build a live facial emotion classification from your camera. we use the FER-2013 dataset for emotion classification to train a deep neural network to classify 7 emotions

Notifications You must be signed in to change notification settings

Gallillio/RealTime_Facial_Emotion_Classification

Repository files navigation

Emotion Detection from Video Feed

This project uses a webcam to detect emotions in real-time using a pre-trained deep learning model. The application is built with Flask for the web interface and OpenCV for video processing.

Dependencies

To run this project, you need the following Python packages:

  • Flask
  • OpenCV
  • TensorFlow
  • h5py
  • numpy

You can install these dependencies using the provided requirements.txt file.

Setup Instructions

  1. Set Up a Virtual Environment (Optional but Recommended):

    • Create a virtual environment to keep your project dependencies isolated.
    python -m venv venv
    • Activate the virtual environment:
      • On Windows:
      venv\Scripts\activate
      • On macOS/Linux:
      source venv/bin/activate
  2. Install Dependencies:

    • Use pip to install the required packages from the requirements.txt file.
    pip install -r requirements.txt
  3. Run the Application:

    • Ensure you have the Haar Cascade file (haarcascade_frontalface_default.xml) in the same directory as your script or provide the correct path in your code.
    • Start the Flask application by running the main.py file:
    python main.py
  4. Access the Application:

    • Open a web browser and go to http://localhost:5000 to access the application.

How It Works

  • The application captures video from the webcam and processes each frame to detect faces.
  • For each detected face, it predicts the emotion using a pre-trained model and displays the emotion label on the video feed.

Notes

  • Ensure that your camera is connected and accessible by OpenCV.
  • If you encounter any issues with TensorFlow, make sure your system meets the requirements for the version you are installing, especially if you are using a GPU.
  • You may need to adjust the versions of the packages in requirements.txt based on your specific environment or compatibility needs.

About

Using Transfer-learning and fine-tuning multiple models (Mobilenetv2, VGG, and building a CNN model from scratch) and comparing results to build a live facial emotion classification from your camera. we use the FER-2013 dataset for emotion classification to train a deep neural network to classify 7 emotions

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages