Giter Site home page Giter Site logo

eye-blink-detection-demo-1's Introduction

eye-blink-detection-demo

A very simple demo code for eye blink detection with dlib libray with python, Note this project is basically dependent on the library dlib. The methods used in the demo code is introduced in Paper. This code is based on the blogEye blink detection with OpenCV, Python, and dlib. Here is the Chinese translationOpenCV/Python/dlib眨眼检测.

Environment

  • win10
  • python 3.5.4
  • opencv 3.3.1
  • imutils 0.4.6
  • dlib 18.18
  • Anaconda3

install packages

conda intall dlib
conda install opencv3
pip install imutils

sample

open the terminal

python detect_blinks.py

The default args open the camera and detect the eye blink in the video sample

python detect_blinks.py -h
optional arguments:
  -h, --help            show this help message and exit
  -p SHAPE_PREDICTOR, --shape-predictor SHAPE_PREDICTOR
                        path to facial landmark predictor
  -v VIDEO, --video VIDEO
                        path to input video file
  -t THRESHOLD, --threshold THRESHOLD
                        threshold to determine closed eyes
  -f FRAMES, --frames FRAMES
                        the number of consecutive frames the eye must be below
                        the threshold

You can see more information about the args, parse a larger threshold means an eye can be more easily considered as closed, vice versa.parse a larger frames means only if the closed eyes last for more frames, can it be considered as a closed eye.You can aslo parse a video file by parsing video args. the shape-predictor args indicate the trained model path which is provided in the demo

eye-blink-detection-demo-1's People

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.