A real-time implementation of facial keypoints detection made with PyTorch
and OpenCV
. Visit here for more details about the dataset used for the training.
- Clone the repository
git clone https://github.com/hash-ir/Facial-Keypoints-Detection.git
cd Facial-Keypoints-Detection
- For running the IPython notebook
Facial Keypoints.ipynb
the following tools are required:
An alternate is to make a conda environment from the environment.yaml
file included in the repository:
conda env create -f environment.yaml
- Once the dependencies are installed, replace the path of
haarcascade_frontalface_default.xml
with your path:
/home/<username>/anaconda3/lib/python3.x/site-packages/cv2/data/haarcascade_frontalface_default.xml # linux
C:\Users\<username>\Anaconda3\envs\<envname>\Lib\site-packages\cv2\data\haarcascade_frontalface_default.xml # windows
- For training, download the dataset from here, extract and put
training.csv
andtest.csv
in the root directory. - For testing, execute the first cell, network architecture code cell and last two code cells. Real-time testing requires webcam!
A real-time demo of me testing it out is here
I have used a fairly simple model and a small dataset (around 1500 samples). Next steps are to incorporate a bigger model and use a bigger dataset and/or data augmentation
- Hashir Ahmad - full project - GitHub
This work is licensed under the MIT License.