Skip to content

Real-time implementation of facial keypoints detection using PyTorch and OpenCV

License

Notifications You must be signed in to change notification settings

hash-ir/Facial-Keypoints-Detection

Repository files navigation

Facial Keypoints Detection

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.

Quick Start

Install

  1. Clone the repository
git clone https://github.com/hash-ir/Facial-Keypoints-Detection.git
cd Facial-Keypoints-Detection
  1. 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
  1. 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

Usage

  1. For training, download the dataset from here, extract and put training.csv and test.csv in the root directory.
  2. For testing, execute the first cell, network architecture code cell and last two code cells. Real-time testing requires webcam!

Demo

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

Author(s)

  • Hashir Ahmad - full project - GitHub

License

This work is licensed under the MIT License.

About

Real-time implementation of facial keypoints detection using PyTorch and OpenCV

Topics

Resources

License

Stars

Watchers

Forks