This project implements a face alignment system using machine learning techniques in Python. It predicts facial landmarks from images, compares deep learning (using CNNs) and classical machine learning approaches (like Ridge regression), and visualizes results. The implementation is done using PyTorch and scikit-learn in a Jupyter Notebook.
- Python 3.8 or higher
- Jupyter Notebook
Install all dependencies using:
pip install -r requirements.txt
Or, install manually:
pip install numpy torch torchvision scikit-learn matplotlib opencv-python
Place your training and test .npz files in a folder named data:
- data/face_alignment_training_images.npz
- data/face_alignment_test_images.npz
- Activate your virtual environment (if using one):
python -m venv venvorvenv\Scripts\activate # On Windowssource venv/bin/activate # On macOS/Linux - Install requirements:
pip install -r requirements.txt - Start Jupyter Notebook:
jupyter notebook - Open the notebook (
face_alignment.ipynb) on Jupyter and run all cells.
The notebook will generate a CSV file with predictions (results_task2.csv) in the results folder.
.
├── data/
│ ├── face_alignment_training_images.npz
│ └── face_alignment_test_images.npz
├── results/
│ └── results_task2.csv
├── face_alignment.ipynb
├── requirements.txt
└── README.md
- Do not upload the
venvfolder or.ipynb_checkpointsto GitHub. - For any issues, please open an issue in this repository.