https://github.com/mktechai-0786/facial-emotion-detector
Face Emotion Recognition using FER Lib
https://github.com/mktechai-0786/facial-emotion-detector
deep-learning fer2013 machine-learning mtcnn-face-detection opencv python tenserflow
Last synced: 21 days ago
JSON representation
Face Emotion Recognition using FER Lib
- Host: GitHub
- URL: https://github.com/mktechai-0786/facial-emotion-detector
- Owner: MKTechAI-0786
- Created: 2024-12-16T16:55:06.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-12-16T17:10:51.000Z (4 months ago)
- Last Synced: 2025-04-09T00:07:15.237Z (21 days ago)
- Topics: deep-learning, fer2013, machine-learning, mtcnn-face-detection, opencv, python, tenserflow
- Language: Python
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Facial-Emotion-Detector
This project is a Facial Emotion Recognition System that uses a webcam or video input to detect faces and identify their emotions in real-time. The program utilizes the FER (Facial Expression Recognition) library for emotion classification and OpenCV for video capture and display.#Features
Real-time emotion detection using a webcam.
Supports multiple emotion classes:
Happy, Sad, Angry, Neutral, Fear, Disgust, Surprise
Draws bounding boxes around detected faces and displays the most likely emotion.#Accuracy
Controlled environments: ~70-80% accuracy (good lighting, frontal faces).
Real-world scenarios: ~50-60% accuracy (varied lighting and non-frontal faces).
Per-emotion classification accuracy (approximate):
Happy: ~93%
Neutral: ~60%
Sad: ~75%
Angry: ~70%
Surprise: ~60%
Fear, Disgust: ~58%#Software Requirements
Make sure the following software and libraries are installed before running the project:
Python 3.8 or later
Required Python packages (install using pip):
"pip install opencv-python-headless fer"
OpenCV: For video capture and processing.
FER: A library for facial expression recognition.#Installation
1. Clone the Repository
git clone https://github.com/yourusername/facial-emotion-recognition.git
cd facial-emotion-recognition2. Install Dependencies
Install all required libraries using pip:
pip install -r requirements.txt3. Run the Program
Run the script to start emotion detection via webcam:
python emotion_detector.py
5. Exit the Program
Press the q key to exit the webcam feed.#Procedure
1. The program captures live video feed from the webcam.
2. It detects faces in real-time using the FER library.
3. For each detected face:
3.1 A bounding box is drawn around the face.
3.2 The most probable emotion (e.g., happy, sad, angry, etc.) is displayed above the box.
4. Results are continuously displayed in a video window.
5. The program exits when the q key is pressed.#Conclusion
This project provides a basic framework for detecting facial emotions using pre-trained models in the FER library. While it works well in controlled environments, accuracy may decrease in real-world settings due to lighting, occlusions, and non-frontal faces. For improved performance, consider using advanced models such as DeepFace or custom fine-tuned neural networks.#Future Improvements
Integrate more advanced models like DeepFace for higher accuracy.
Add support for analyzing emotion trends over time.
Improve robustness under varying lighting conditions.