https://github.com/nafisatibrahim/facial-landmarks-detection
Facial landmark detection is widely used in computer vision for tasks like face alignment, expression tracking, AR filters, and emotion analysis. This project showcases how it can be applied efficiently using MediaPipe and Streamlit.
https://github.com/nafisatibrahim/facial-landmarks-detection
animation augmentation-reality computer-vision human-computer-interaction landmark-detection mediapipe
Last synced: 3 months ago
JSON representation
Facial landmark detection is widely used in computer vision for tasks like face alignment, expression tracking, AR filters, and emotion analysis. This project showcases how it can be applied efficiently using MediaPipe and Streamlit.
- Host: GitHub
- URL: https://github.com/nafisatibrahim/facial-landmarks-detection
- Owner: Nafisatibrahim
- Created: 2025-06-10T00:30:26.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-10T02:23:10.000Z (about 1 year ago)
- Last Synced: 2025-06-17T08:07:28.638Z (about 1 year ago)
- Topics: animation, augmentation-reality, computer-vision, human-computer-interaction, landmark-detection, mediapipe
- Language: Python
- Homepage: https://facial-landmarks-detection.streamlit.app/
- Size: 12.1 MB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# π§ Facial Landmark Detection Using MediaPipe
A Simple Computer Vision Web App for Visualizing Facial Mesh
---
## π§ Overview
This project implements real-time facial landmark detection using **MediaPipe Face Mesh** and displays facial mesh lines on portrait images via a **Streamlit web app**. Rather than predicting expressions or performing face recognition, the focus is on understanding facial structure through mesh overlay.
## πΌοΈ Sample Output
Hereβs an example of the facial mesh overlay:
## π Live Demo
π [Web App hosted on Streamlit Cloud](https://facial-landmarks-detection.streamlit.app/)
Key steps included:
- Image upload and preprocessing using Pillow and NumPy
- Facial landmark detection using MediaPipe's pre-trained FaceMesh model
- Visualization of facial mesh (lines only, no dots) using OpenCV
- Web app creation and deployment using Streamlit
- Optional enhancements: region highlighting (eyes, lips, etc.) and real-time webcam extension
---
## π¦ Input
- **Image input**: User-uploaded `.jpg`, `.jpeg`, or `.png` portrait image
- **Face detection model**: MediaPipe's built-in face mesh estimator
- **Output**: Original image with facial mesh lines drawn
---
## π Highlights
- Detects **468 facial landmarks** per face
- Supports **1 face per image** (can be extended)
- Draws only **mesh lines** (tesselation), without cluttering with dots
- Works well on **clear, front-facing images**
- Fully deployable as a **Streamlit web app**
---
## π€ How It Works
1. User uploads an image
2. Image is converted to RGB and passed to MediaPipe FaceMesh
3. If a face is detected:
- Facial landmarks are returned
- Connections (lines) are drawn using OpenCV
4. Final image is displayed using Streamlit
---
## π‘ Key Takeaways
- Facial mesh detection is possible without training any model
- MediaPipe is efficient and accurate for landmark extraction
- Streamlit is a powerful tool for quick deployment of ML/vision prototypes
- OpenCV and PIL can be used together for both preprocessing and overlaying
---
## π Tools Used
- Python (NumPy, OpenCV, Pillow)
- MediaPipe
- Streamlit
- Git & GitHub
---
## π Live Demo
π [Web App hosted on Streamlit Cloud](https://facial-landmarks-detection.streamlit.app/)
---
## π€ Author
**Nafisat Ibrahim**
---
## π₯ Resources & Downloads
- π [View Source Code (`app.py`)](./app.py)
- π¦ [View Requirements (`requirements.txt`)](./requirements.txt)
- π οΈ [System Dependencies (`packages.txt`)](./packages.txt)
---