This project implements a real-time facial expression detection system using a Convolutional Neural Network (CNN) in Python. It classifies facial expressions into three categories: sad, happy, and surprise. The system captures live video feed from a webcam and displays the predicted expression on the video.
This project is designed to detect facial expressions in real-time using a pre-trained model on a dataset containing images categorized as sad, happy, and surprise. It is organized into separate scripts for data preprocessing, model training, and real-time detection.
.
├── prepare_data.py # Script for data preprocessing
├── train_model.py # Script for building and training the model
├── main.py # Script for real-time facial expression detection
├── requirements.txt # Required dependencies
└── README.md # Project documentation
## Requirements
Python 3.8+
TensorFlow 2.x
OpenCV
Numpy
Scitkit-Learn
Install the necessary dependencies using:
pip install -r requirements.txt
## Setup
1. Clone the Repository
git clone https://github.com/yourusername/facial-expression-detection.git
cd facial-expression-detection
## Prepare Dataset
The dataset used for this project is not included. Ensure your dataset is organized as follows:
dataset/
├── sad/
├── happy/
└── surprise/
Note: This repository does not include any pre-trained models or datasets due to size and privacy limitations. Make sure to prepare your dataset and follow the setup instructions carefully.
This `README.md` provides a full setup guide and clear instructions for usage, covering dependencies, data preparation, and each script’s function within the project. Let me know if any additional details are needed!