How siddhesh1108/smart-video-attention-controller works
Smart Video Attention Controller combines webcam-based attention detection with local playback controls. The main workflow captures frames, estimates eye state and head pose, then calls the local Flask API to pause, resume, or rewind after distraction thresholds. Separately, the Chrome extension provides popup-driven controls for HTML5 video. The README describes the server as triggering the extension, but the sampled server code uses PyAutoGUI keyboard presses instead; the graph keeps these paths distinct. Source excerpts do not establish a connection from the Python workflow to the extension.
Main entry points: main.py Attention loop · content.js Video controller · detector.py Eye detector · server.py Flask API
Components 14
Attention sensing
- Attention loop
main.py - Eye detector
detector.py - Eye ratio
utils.py - Head pose
head_pose.py - Attention tracker
attention.py
Python control
- Flask API
server.py - Keyboard control
Browser extension
- Extension popup
youtube_attention_extension/popup.js - Extension config
youtube_attention_extension/manifest.json - Video controller
youtube_attention_extension/content.js - Install listener
youtube_attention_extension/background.js
Other components
- Viewer
- Webcam
- HTML5 player
Connections 12
- Viewer → Webcam: faces
README.md - Webcam → Attention loop: frames
main.py - Attention loop → Eye detector: detects eyes
main.py - Eye detector → Eye ratio: calculates ratio
detector.py - Attention loop → Head pose: estimates pose
main.py - Attention loop → Flask API: requests controls
main.py - Flask API → Keyboard control: presses keys
server.py - Keyboard control → HTML5 player: controls playback
- Extension popup → Video controller: sends commands
youtube_attention_extension/popup.js - Video controller → HTML5 player: controls video
youtube_attention_extension/content.js - Extension config → Video controller: registers script
- Install listener → Extension config: installation event