In our computer vision application, we wanted to add a person’s face data into a database by capturing it from a camera. Typically, this requires capturing images from multiple facial angles manually — such as:
- Left profile
- Right profile
- Upward (top) view
- Downward (bottom) view
- Center (frontal) view
Manually clicking images while instructing a person to rotate their head is time-consuming and error-prone.
Automate the face pose capturing process using machine learning. Once the camera starts, the model should automatically identify the current head position and capture the face when it matches any of the five desired directions.
To solve this, we used InsightFace's face pose estimation features — extracting 3 key pose parameters:
yaw
roll
pitch
Using these, we created a dataset where each face image was labeled based on its pose direction. Then, we trained a Logistic Regression model using a total of 150 features derived from the face landmarks and pose data.
- ✅ Model: Logistic Regression
- 📈 Accuracy: ~90%
- 🔢 Features Used: 150 pose-related features
- 🧪 Evaluation: Based on test set performance and live camera testing.
├──app
├── captured_face_sides/ # all captured face images
├── configs/ # all configuration
├── data/ # all data related scripts
├── models/
├── src/
├── ..
├── ..
├── live.py
├── main.py
└── README.md # Project documentation
Watch the project demo here: Demo Video on Google Drive
Run the following to test the model on a live webcam feed:
git clone https://github.com/ak-123459/LookWhere.git
cd LookWhere
pip install -r requirements.txt
python app/live.py
python app/main.py
Algorithm: Logistic Regression
Input: Pose features (yaw, pitch, roll, etc.)
Output: Face direction label
Hyperparameters and model configs can be found and edited in config.yaml.
This project is licensed under the MIT License.