A computer vision project that detects facial emotions from webcam input by extracting facial landmarks and classifying them with a machine learning model.
This project demonstrates a full end-to-end machine learning workflow:
- collecting structured facial data,
- training a classification model,
- and deploying it in a live real-time demo.
It is a strong example of applied Python, OpenCV, and scikit-learn skills for roles in AI, computer vision, and data science.
- Real-time face mesh landmark extraction
- Emotion data collection from webcam input
- Training pipeline for a supervised classifier
- Live demo for instant emotion prediction
- Clean, modular project structure for easier extension
- Python
- OpenCV
- cvzone
- NumPy
- pandas
- scikit-learn
Emotion-Detection/
├── data/
│ └── data.csv
├── models/
│ └── model.pkl
├── scripts/
│ ├── common.py
│ ├── generate_data.py
│ ├── train_model.py
│ └── live_demo.py
├── datagen.py
├── training.py
├── test.py
├── requirements.txt
└── README.md
git clone <your-repository-url>
cd Emotion-Detectionpython -m venv .venv
source .venv/bin/activate # macOS/Linux
.venv\Scripts\activate # Windowspip install -r requirements.txt- Data collection
- Run the data collection script to capture facial landmarks and label them.
- Model training
- Train a classifier on the collected dataset.
- Live prediction
- Run the demo to classify emotions from a webcam stream.
python datagen.pypython training.pypython test.py- Working with computer vision pipelines
- Preparing structured data for machine learning
- Building a practical ML demo from scratch
- Organizing a project for readability and maintainability
- Add more emotion classes
- Improve model accuracy with more diverse data
- Experiment with deep learning models
- Add a GUI or web interface
This project is intended for educational and portfolio purposes.