Nizomiddin Xalilov

Work / Driver Drowsiness Detector

2024 · Personal project In production

Driver Drowsiness Detector

Eye Aspect Ratio in real time from a webcam. When the eyes stay closed too long, it makes noise.

A small, focused computer vision tool: MediaPipe finds facial landmarks, OpenCV computes the eye aspect ratio frame by frame, and a sustained drop below threshold triggers an audio-visual alert.

Problem

Why I built it

Working around long-haul logistics, driver fatigue is not an abstract topic. I wanted to know how far a laptop webcam and classical computer vision could get without a trained model.

Decisions & trade-offs

Decisions

Geometry instead of a trained classifier. EAR is a ratio computed from six landmarks. No dataset, no training, no GPU — and it runs at full frame rate on a laptop.

Duration, not a single frame. Blinking is a drop in EAR too. Only a sustained drop across consecutive frames counts, which is the entire difference between a useful alert and a device that beeps at every blink.

Outcome

Outcome

It works well in good light and degrades exactly where you would expect: glasses with glare, darkness, a head turned away from the camera.

I keep it here because it is honest about its limits, and because the duration-threshold idea is the same principle I later used for multi-frame consensus in the yard system.