Git Product home page Git Product logo

wahid18benz / detect-facial-features Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 2.0 7.76 MB

Using dlib, OpenCV, and Python, to detect in real time how to open/closed eyes,mouth, position of the head, and the emotion

Python 100.00%
facial-landmarks facial-detection facial-keypoints facial-expressions real-time-face-detection real-time-face-recognition facial-emotion-recognition opencv python deep-learning

detect-facial-features's Introduction

Detect-Facial-Features in real time

Using dlib, OpenCV, and Python, to detect in real time open/closed eyes,mouth, position of the head, and the emotion

This is a real time facial detection, The application.py will start your webcam automatically. The program is based on Dlib which help to extract the cordinates for facial features like eyes, nose, mouth and jaw using 68 facial landmark indexes. The application detect on real time open/closed eyes,mouth, position of the head, and the emotion. and mention it on the top left of the window.

  • The Face detection is associated with the file "haarcascade_frontalface_default.xml"
  • The emotion is based on emotion_classifier associated with the file " _mini_XCEPTION.102-0.66.hdf5"
  • The Open/Closed eyes is based on smile function which return a threshold
  • The Open/Closed mouth is based on eye_aspect_ratio function which return a threshold
  • The position of the head is based on center_face function

68 Facial landmark indexes The facial landmark detector implemented inside dlib produces 68 (x, y)-coordinates that map to specific facial structures. These 68 point mappings were obtained by training a shape predictor on the labeled iBUG 300-W dataset.

Below we can visualize what each of these 68 coordinates map to:

Image description

Examining the image, we can see that facial regions can be accessed via simple Python indexing (assuming zero-indexing with Python since the image above is one-indexed):

  • The mouth can be accessed through points [48, 68].
  • The right eyebrow through points [17, 22].
  • The left eyebrow through points [22, 27].
  • The right eye using [36, 42].
  • The left eye with [42, 48].
  • The nose using [27, 35].
  • The jaw via [0, 17].

These mappings are encoded inside the FACIAL_LANDMARKS_IDXS dictionary inside face_utils of the imutils library.

detect-facial-features's People

Contributors

wahid18benz avatar

Stargazers

 avatar  avatar

Watchers

 avatar  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.