Project overview
A closer look at the experience.
Drowsy driving causes accidents that a simple alert could prevent. This system tracks 68 facial landmarks with dlib, computes the eye aspect ratio (EAR) for every frame and recognises blinks, drowsiness warnings and prolonged eye closure. When the eyes stay closed beyond the threshold an alarm plays and the event is written to an alert log. A Streamlit web app (installable as a PWA) shows the live feed, telemetry and adjustable thresholds, and a lane detection module adds road awareness. Screens use sample data.
01
The challenge
Fatigue builds up gradually and drivers rarely notice it until it is dangerous, so detection has to be real time, accurate and non-intrusive.
02
The solution
A Python pipeline with OpenCV and dlib landmarks that computes EAR per frame, a state machine for awake, warning and alert, an audible alarm and a Streamlit dashboard with live telemetry.
What it does
What we delivered.
- Real-time eye tracking from any webcam
- Eye aspect ratio computed every frame
- Blink, warning and alert states
- Audible alarm and alert log
- Adjustable EAR threshold and frame count
- Live telemetry chart
- Lane detection module
- Installable Streamlit PWA with offline caching
How it gets built
How the work ran.
- Understand the operation
Map the users, business objective, current tools and data. Agree what a useful result looks like.
Problem & scope - Design the system
Define architecture, integrations and access. Make assumptions and dependencies visible before implementation.
Technical approach - Build, test, refine
Deliver focused milestones and review representative scenarios, including exceptions and human approvals.
Working milestones - Handover & improve
Document ownership, establish monitoring and identify the next improvements with your team.
Operational handover
The result
What the client gained.
- Alarm after 20 consecutive closed-eye frames, well under a second on a 30 fps webcam
- Works with a standard laptop webcam, no special hardware
