Giter VIP home page Giter VIP logo

facial-landmarks's Introduction

Facial Landmarks Detection

Steps to find 68 points facial landmarks using OpenCV :

  1. First read image frame from disk
  2. Create face detector object (please read below notes for more details)
  3. Find faces from frame using face detector object
  4. Find facial landmarks on faces using 'shape_predictor_68_face_landmarks.dat'

Here I have tried below face detectors for finding landmarks:

  1. Dlib's get_frontal_face : based on HOG + SVM classifier
  2. Dlib's cnn_face_detection_model_v1 : CNN architecture trained model mmod_human_face_detector.dat
  3. OpenCV's DNN module : Pre-trained deep learning caffe model with SSD method

Installation

To start with project just follow the few steps

$ git clone https://github.com/keyurr2/face-detection.git
$ pip install -r requirements.txt
$ cd into <project-folder>

Now you need to download models from below url and put in project directory

  1. http://dlib.net/files/shape_predictor_68_face_landmarks.dat.bz2
  2. https://github.com/keyurr2/face-detection/blob/master/deploy.prototxt.txt
  3. https://github.com/keyurr2/face-detection/blob/master/res10_300x300_ssd_iter_140000.caffemodel
  4. https://github.com/keyurr2/face-detection/blob/master/mmod_human_face_detector.dat

To find facial landmarks in realtime with different methods

$ python facial_landmarks_realtime.py -l hog
$ python facial_landmarks_realtime.py -l cnn
$ python facial_landmarks_realtime.py -l dl

To find for the same in image just give image path like

$ python facial_landmarks.py -l hog -i <image-path>

(Please change HOME in script)

Screenshot

HOG+SVM vs CNN vs DNN

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details

facial-landmarks's People

Contributors

keyurr2 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.