Git Product home page Git Product logo

eyeblink's Introduction

EyeBlink

This is a computer vision application that is capable of detecting and counting blinks in video streams using facial landmarks. To find if the user is blinking, it uses a metric called the eye aspect ratio (EAR) that involves a very simple calculation based on the ratio of distances between facial landmarks of the eyes. Here the server plays a video from YouTube and notes down the times at which the users blink (through their webcam) while watching the video and for further analysis.

Installation:

Clone this project:

git clone https://github.com/aditi15ashley/EyeBlink.git

Install the dependencies:

pip install -r requirements.txt

Run the demo:

python server.py

How it works:

The EAR measures the ratio of the horizontal eye landmarks to the vertical eye landmarks. The eye aspect ratio is approximately constant while the eye is open, but will rapidly fall to zero when a blink is taking place. If the EAR falls below a certian threshold, it is counted as a blink. The threshold currently set is 0.21 which can be changed to whatever seems appropriate. Note that the face should be as parallel to the screen as possible for accurate detection to take place.

The raw code for this application is in eyeblink.py which simply does the job of detecting the eyeblinks and can be used for applications other than keeping track of when a user blinks while watching a YouTube video.

To keep track of the eyeblinks in a saved webcam video feed from the disk instead of doing it in real-time, in eyeblink.py, uncomment line 59 and comment line 61 and run it like this:

$ python eyeblink.py \
	--video blink_detection_demo.mp4

eyeblink's People

Contributors

aditi15ashley avatar

Watchers

Saurav Kumar 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.