The project is now live on Hugging Face Spaces! Try it out directly:
- 📸 Image Upload Frontend (Original Design)
- 🎥 Live Video Prediction (Premium Design)
- ⚙️ Backend API (FastAPI)
Facial Emotion Detection System is an open-source project designed to identify human emotions from images and real-time video streams using advanced Convolutional Neural Networks (CNNs). The project is modular, containerized using Docker, and made accessible for global use through Hugging Face Spaces.
- Backend: A RESTful API built with FastAPI for image-based emotion detection.
- Frontend (Image): A static web interface for uploading images and viewing predictions (Original Design).
- Frontend (Video): A premium web interface for real-time webcam emotion detection.
- ResNet50V2: Powered by a high-accuracy deep learning architecture.
- Dockerized: Fully containerized for easy deployment.
Facial-Emotion-Detection-System/
├── backend/ # Backend service (FastAPI)
│ ├── main.py # API implementation
│ ├── Dockerfile # Deployment config
│ └── haarcascade_frontalface_default.xml
├── frontend/ # Image Upload Frontend (Original)
│ ├── index.html
│ ├── styles.css
│ └── scripts.js
├── video_prediction/ # Video Prediction Frontend (Premium)
│ ├── index.html
│ ├── styles.css
│ └── scripts.js
├── Notebooks/ # Training and Analysis
├── demo/ # Visual assets
└── README.md # Project documentation
Simply visit the links in the Live Demo section above to try the application without any setup.
git clone https://github.com/Muhammad-Sheraz-ds/Facial-Emotion-Detection-System.git
cd Facial-Emotion-Detection-Systemcd backend
pip install -r requirements.txt
uvicorn main:app --reloadOpen frontend/index.html (for image upload) or video_prediction/index.html (for live video) in your modern web browser.
The pretrained model weights are stored in the Docker image and deployed to Hugging Face Spaces. If running locally, ensure you have the ResNet50_final_weights.weights.h5 file in the backend/weights/ directory.
This project is licensed under the MIT License.
Built by Muhammad Sheraz

