Проекты / Driver Drowsiness Detector
Driver Drowsiness Detector
Eye Aspect Ratio в реальном времени с веб-камеры. Если глаза закрыты слишком долго — сигнал.
EAR считается по шести точкам. Моргание игнорируется; длительное падение ниже порога включает сигнал.
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.
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
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
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.