pretrainedmchns / blink-detector

Build an AI Sleep Detector in Less than 60 minutes using Tensorflow-JS

Home Page:https://pretrainedmchns.github.io/blink-detector/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This repository hosts code to run a blink detector/alarm in your browser. The code uses a pretrained facial keypoint detector model, hosted on the tf-js models repository.

The code has been taken from the facial landmark detector demo (FLD) page of the repository and has been refactored to work in the browser using Tensorflow-JS 2.4.0.

How Does It Work?

After the FLD model predicts the keypoint location. Eyebrow keypoints (refer to mesh map) are used to calculate the distance between the left and right eyebrows.

The distance is plotted on a line chart for easy visualization. Whenever the distance for both left and right eye falls below a threshold, a beep function is called.

What can YOU Do?

The following are some low hanging fruits for you to try:

  • Add code to make the blink detection robust to camera angle changes.
  • Add code for automatic threshold calculation.

Feedback

Please create an issue on this repository or write to us on pretrainedmachines@gmail.com on any issue/thoughts on this repository.

Follow us on @pretrainedmchns on Twitter and Github.

We are waiting to hear from you.

About

Build an AI Sleep Detector in Less than 60 minutes using Tensorflow-JS

https://pretrainedmchns.github.io/blink-detector/


Languages

Language:JavaScript 91.7%Language:HTML 8.3%