Downloads · 30 days
0
FatimaNoorAI/emotion-detection-media-pipe
emotion-detection-media-pipe is a machine learning model from FatimaNoorAI. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This project detects human emotions in real-time using MediaPipe FaceMesh and OpenCV. It analyzes facial landmarks to classify simple emotions such as Happy, Sad, Surprised, and Neutral.
Downloads · 30 days
0
Access
Public
Updated Aug 24, 2026
Repo size
—
Likes
0
Public
Click a slice to open those files.
.py6.1 KB · 54%
From the Hugging Face model README
This project detects human emotions in real-time using MediaPipe FaceMesh and OpenCV.
It analyzes facial landmarks to classify simple emotions such as Happy, Sad, Surprised, and Neutral.
This project uses:
It runs in Google Colab and saves the output video with detected emotions displayed on-screen in bold text.
✅ Detects facial emotions in video files
✅ Uses real-time FaceMesh landmark extraction
✅ Displays the emotion name on screen in large, dark text
✅ Saves the processed output video to Google Drive
✅ Beginner-friendly — easy to extend with ML-based classifiers
Emotion-Detection-MediaPipe/
│
├── emotion_detection.ipynb # Main Google Colab notebook
├── input_videos/ # Folder containing input videos
├── output_videos/ # Folder where processed videos are saved
└── README.md # Project documentation
Install the required libraries before running the notebook:
pip install opencv-python mediapipe numpy scipy
| Emotion | Rule |
|---|---|
| Happy | Mouth width ↑, mouth height ↑ |
| Sad | Mouth narrow ↓, eyes slightly closed ↓ |
| Surprised | Mouth height ↑↑, eyes wide open ↑↑ |
| Neutral | No major change in facial geometry |
When the model processes a video, you’ll see text such as:
Emotion: Happy
<img width="552" height="887" alt="image" src="https://github.com/user-attachments/assets/6eff93fb-b132-4362-bb37-379d35506b2a" />
displayed clearly on the person’s face in large, dark text.
Make sure to update the paths in your notebook before running:
video_path = "/content/drive/MyDrive/AI ML Projects/Emotion-Detection/input/video1.mp4"
output_path = "/content/drive/MyDrive/AI ML Projects/Emotion-Detection/output/video1_output.mp4"
Fatima Noor
AI/ML Developer | Python Enthusiast
📧 [GitHub Profile Link Here]
📍 Based in Pakistan
The project was inspired by how subtle changes in facial expressions reveal human emotions — bringing AI closer to understanding empathy.
Built with ❤️ using MediaPipe, OpenCV, and Python.