A real-time facial orientation detector using MediaPipe and OpenCV that assesses if a person is looking directly at the camera by analyzing 3D facial landmarks and Euler angles. It calibrates to individual posture and camera setup, outputting the face's orientation status live.
Here are some screenshots demonstrating the app in action:
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
What things you need to install the software and how to install them:
- Python 3.9
- OpenCV
- MediaPipe
- Transforms3d
-
Clone the Repository
git clone https://github.com/dan-yates1/flash-pack-task cd flash-pack-task
-
Create and Activate a Virtual Environment (Optional but recommended)
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install Dependencies
pip install -r requirements.txt
-
Run Main
python main.py
- OpenCV - The computer vision library used
- MediaPipe - Framework for building multimodal applied machine learning pipelines
- Transforms3D - Python library for 3D coordinate transformations
- Real-Time Head Pose Estimation FaceMesh with MediaPipe and OpenCV: A Comprehensive Guide - Used code for drawing coordinates
- Python Face Detection and Face Mesh (python OpenCV & MediaPipe package) - Support for setting up the project