How suman222222/doom_scrolling_detector works
This is a small, single-script desktop gaze-monitoring assistant. The user starts the application, which reads webcam frames, detects face landmarks, estimates downward gaze, applies a timed state machine, and plays an alarm after the grace period; the live window shows the measured ratio and state. The README also documents calibration through threshold and grace-period settings. The workflow is implemented in main.py; component boundaries below describe its runtime responsibilities, not separate modules.
Main entry points: main.py Frame Capture · face_landmarker.task Landmarker Model · alarm.wav Alarm Audio
Components 13
Gaze Detection
- Frame Capture
main.py - Frame Preparation
main.py - Face Landmarker
main.py - Landmarker Model
assets/face_landmarker.task - Iris Ratio
main.py - Gaze State Machine
main.py
Alert and Display
- Alarm Thread
main.py - Alarm Playback
main.py - Alarm Audio
assets/alarm.wav - Camera Window
main.py
Other components
- User
- Gaze Monitor
main.py - Webcam
Connections 14
- User → Gaze Monitor: starts
README.md - Webcam → Frame Capture: provides frames
main.py - Gaze Monitor → Frame Capture: opens stream
main.py - Frame Capture → Frame Preparation: passes frames
main.py - Frame Preparation → Face Landmarker: submits image
main.py - Landmarker Model → Face Landmarker: configures model
main.py - Face Landmarker → Iris Ratio: returns landmarks
main.py - Iris Ratio → Gaze State Machine: sets gaze flag
main.py - Gaze State Machine → Alarm Thread: starts or stops
main.py - Alarm Thread → Alarm Playback: runs playback
main.py - Alarm Playback → Alarm Audio: plays file
main.py - Frame Capture → Camera Window: shows annotated frame
main.py - Gaze State Machine → Camera Window: shows status
main.py - Camera Window → Gaze Monitor: q stops loop
main.py