Downloads · 30 days
0
RashaadAhmad/Emotion-Detection
Emotion-Detection is a image-to-image model from RashaadAhmad. Use it when you need one image transformed into another. The card lists the license as mit.
This project is a real-time emotion detection application that uses a deep learning model to identify emotions from human faces in images. The application is built with Python and utilizes PyTorch for the model, OpenC…
Downloads · 30 days
0
Access
Public
Updated Jan 21, 2026
Repo size
10.9 MB
Likes
0
Public
Click a slice to open those files.
.pt10.9 MB · 100%
From the Hugging Face model README
This project is a real-time emotion detection application that uses a deep learning model to identify emotions from human faces in images. The application is built with Python and utilizes PyTorch for the model, OpenCV for image processing, and Gradio for the user interface.
├── app.py # Main application file with the Gradio interface
├── requirements.txt # Project dependencies
├── checkpoints/ # Contains pre-trained model weights
│ ├── emotion_recognition/
│ └── face_detect/
├── dataset/ # Image data for training and testing
│ └── emotions/
└── src/ # Source code for the project
├── dataset.py # Handles data loading
├── emotion_recognition_model.py # Emotion recognition model architecture
├── face_detect_model.py # Face detection model architecture
├── pipeline.py # Chains face detection and emotion recognition
└── train.py # Script for training the models
Clone the repository:
git clone https://huggingface.co/RashaadAhmad/Emotion-Detection
cd emotion-detection
Create and activate a virtual environment (recommended):
python -m venv venv
source venv/bin/activate # On Windows, use `venv\Scripts\activate`
Install the dependencies:
pip install -r requirements.txt
Click Here to try it out.
To start the application and its web interface, run the following command:
python app.py
This will launch a local web server. Open the provided URL in your browser to access the application. You can then upload an image to see the emotion detection in action.
The model has been pre-trained, and the weights are available in the checkpoints directory. However, if you wish to retrain the model on a different dataset, you can use the train.py script:
python src/train.py
Make sure your dataset is structured correctly in the dataset directory.