BCSAI · AI: Computer Vision · Group Project
A real-time fatigue detection system that watches for closing eyes, yawns, and a drooping head — and only switches on once the driver performs the right gesture sequence. Classical computer vision and a deep CNN, working together.
01 — Overview
The system simulates an in-car monitoring scenario using a webcam or recorded video. It detects fatigue with both classical computer-vision heuristics and a trained deep-learning eye classifier — and recommends running them together in a hybrid mode where each covers the other's blind spots.
02 — How it works
03 — Gesture-based activation
The detector starts inactive by default. It only arms after the driver performs a correct sequence of gestures — the right gestures, in the right order, within a time limit — handled by a small state machine.
System idle, no monitoring.
Correct gestures, correct order, under a time constraint.
Normal driving condition confirmed.
Fatigue detected — the system raises the flag.
04 — Model performance
The CNN eye classifier was trained and evaluated on the MRL Eye Dataset. The dataset is used only for training and evaluation — never at runtime.
05 — Architecture
. ├── src/ │ ├── main.py # entry point — webcam or video │ ├── fatigue/ # basic.py (classical) · dl.py (CNN) │ ├── gestures/ # classifier.py · state_machine.py │ └── utils/ # dataset download helpers ├── scripts/ │ ├── train_eye_classifier.py │ └── evaluate.py ├── models/ │ ├── eye_classifier.pt # trained CNN weights │ └── hand_landmarker.task # gesture landmarks ├── tests/ # test_gesture.py · test_sequence.py └── requirements.txt
classical (traditional CV only) · dl (deep learning only) · both (combined, recommended). Launch with python -m src.main --mode both.06 — Stack