Skip to content

Computer vision: Detect facial keypoints using PyTorch and OpenCV

License

Notifications You must be signed in to change notification settings

nalbert9/Facial-Keypoint-Detection

Repository files navigation

Facial Keypoint Detection

Project Overview

This repository contains project files for Computer Vision. It combine knowledge of Computer Vision Techniques and Deep learning Architectures to build a facial keypoint detection system that takes in any image with faces, and predicts the location of 68 distinguishing keypoints on each face. Facial keypoints include points around the eyes, nose, and mouth on a face and are used in many applications (facial tracking, facial pose recognition, facial filters, and emotion recognition).

Examples

  • Detect all faces using Haar Cascade Classifiers using OpenCV

drawing

  • Detect facial keypoint with a Convolutional Neural Network

drawing

Project Structure

The project will be broken up into a few main parts in four Python notebooks:

models.py

Notebook 1 : Loading and Visualizing the Facial Keypoint Data

Notebook 2 : Defining and Training a Convolutional Neural Network (CNN) to Predict Facial Keypoints

Notebook 3 : Facial Keypoint Detection Using Haar Cascades and your Trained CNN

Notebook 4 : Fun Filters and Keypoint Uses

Local Environment Instructions

  1. Clone the repository, and navigate to the downloaded folder. This may take a minute or two to clone due to the included image data.

    git clone https://github.com/nalbert9/Facial-Keypoint-Detection.git
    
  2. Create (and activate) a new Anaconda environment (Python 3.6). Download via Anaconda

    • Linux or Mac:
    conda create -n cv-nd python=3.6
    source activate cv-nd
    
    • Windows:
    conda create --name cv-nd python=3.6
    activate cv-nd
    
  3. Install PyTorch and torchvision; this should install the latest version of PyTorch;

conda install pytorch torchvision cudatoolkit=9.0 -c pytorch
  1. Install a few required pip packages, which are specified in the requirements text file (including OpenCV).
pip install -r requirements.txt

Licence

This project is licensed under the terms of the License: MIT