How senbenz/sentinel works
Sentinel is a real-time driver-fatigue monitor: it reads camera frames, detects facial landmarks, derives fatigue metrics, scores risk, escalates alerts, and displays an on-frame status panel. Startup calibration personalizes eye-closure detection; optional CSV recording and an LSTM scoring/training path support model-based scoring. The graph reflects sampled code and SOURCE INDEX references; unsampled wiring is omitted where the excerpts do not establish it.
Main entry points: Orchestration.py Runtime orchestration · Calibration.py EAR calibration · lstm_scorer.py LSTM inference · lstm_train.py Model training
Components 15
Capture and calibration
- Runtime orchestration
Orchestration.py - EAR calibration
Calibration.py
Fatigue analysis
- Fatigue metrics
Metrics.py - Formula scorer
Scorer.py
Alerts and display
- Alert escalation
Alert.py - Sound manager
Alert.py - Visual overlay
Overlay.py
LSTM learning
- LSTM inference
lstm_scorer.py - Feature normalization
lstm_data.py - LSTM model
lstm_model.py - Model training
lstm_train.py - Session recording
Orchestration.py
Other components
- Driver
- Camera
- FaceLandmarker
Connections 18
- Driver → Camera: provides video
- Runtime orchestration → Camera: reads frames
Orchestration.py - Runtime orchestration → FaceLandmarker: detects faces
Orchestration.py - Runtime orchestration → EAR calibration: calibrates EAR
Orchestration.py - EAR calibration → FaceLandmarker: processes frames
Calibration.py - EAR calibration → Fatigue metrics: computes EAR
Calibration.py - Runtime orchestration → Fatigue metrics: updates metrics
Orchestration.py - Runtime orchestration → Formula scorer: scores snapshots
Orchestration.py - Runtime orchestration → LSTM inference: selects optionally
Orchestration.py - LSTM inference → Feature normalization: normalizes features
lstm_scorer.py - LSTM inference → Formula scorer: falls back during warmup
lstm_scorer.py - Runtime orchestration → Alert escalation: updates alert state
Orchestration.py - Alert escalation → Sound manager: plays alert tones
Alert.py - Runtime orchestration → Visual overlay: draws status panel
Orchestration.py - Runtime orchestration → Session recording: records snapshots
Orchestration.py - Model training → Feature normalization: builds sequences
lstm_train.py - Model training → LSTM model: trains model
lstm_train.py - Driver → Visual overlay: views status