A driver's view of a dark highway at night, lane markings lit by headlights

Driver vigilance, in real time

It notices the moment
your eyes start to close.

Vigil reads the subtle geometry of an eye and raises the alarm the instant drowsiness sets in. On-device computer vision, no footage ever leaves the car.

0.25EAR alarm threshold
30 fpsreal-time on a laptop
IEEEpeer-reviewed, ICCMC 2021
0 bytesleave your device

The idea

One ratio tells you when an eye closes.

The Eye Aspect Ratio compares the height of an eye to its width. Open eyes hold a steady value; as the lids fall, it collapses toward zero. Track it across frames and drowsiness becomes a number you can act on.

01

Find the eyes

MediaPipe FaceMesh locates 468 facial landmarks, six per eye, on every frame from the camera.

02

Measure the ratio

Vigil computes the Eye Aspect Ratio from those six points, the same formula Soukupá and Čech defined for blink detection.

03

Watch for the dip

A small state machine waits until the ratio stays below threshold for twenty straight frames, then sounds the alarm.

Studio portrait of a person, eyes open and alert
EAR = (‖p₂−p₆‖ + ‖p₃−p₅‖) / 2‖p₁−p₄‖

Higher means open. Lower means the lids are falling. The threshold sits at 0.25.

Live demo

Try it on your own camera.

Everything below runs in this browser tab. Grant camera access, close your eyes for a second, and watch the reading fall past the line.

Camera off
Standby
Eye Aspect Ratio
Frames closed0
Alerts0
Rate0fps
EAR over timethreshold 0.25

Research

Vigil began as a peer-reviewed paper on real-time drowsiness detection, presented at the 5th IEEE International Conference on Computing Methodologies and Communication.
S. Santhanam et al. · IEEE ICCMC 2021 Read the paper