Study or Else is a frog-themed focus timer that uses live computer vision to monitor attention during a study session. It combines a Pomodoro-style timer, webcam-based focus tracking, phone detection, live UI feedback, and a session summary screen.
The project is built as a static web app with HTML, CSS, and JavaScript, and uses MediaPipe Face Mesh plus TensorFlow.js COCO-SSD directly in the browser.
- Select a
25,45, or60minute study session - Choose background audio:
rain,classical, orlo-fi - Use webcam-based focus monitoring during the session
- Detect:
- face presence
- head orientation
- eye gaze direction
- phone presence in the frame
- Trigger focused, warning, and distracted states
- Show live visual feedback with frog-themed animations and sounds
- Track:
- focus score
- distraction count
- distraction breakdown
- focused vs distracted time
- Display a summary screen at the end of the session
The system pipeline is:
Webcam inputFace landmark detectionwith MediaPipe Face MeshPhone detectionwith COCO-SSDFeature extraction- head turn
- head vertical angle
- eye gaze left/right
- eye gaze up/down
- phone state
Rule-based focus logic- focused
- warning
- distracted
UI feedback and session tracking
The CV system lives in cv.js.
It uses:
MediaPipe Face Meshfor facial landmarks and iris trackingTensorFlow.js COCO-SSDfor object detection, specificallycell phone
From the landmarks, the app estimates:
- whether the head is facing forward
- whether the head is tilted down
- whether the eyes are looking left, right, center, up, or down
The phone detector runs periodically and keeps detections alive briefly so the result does not flicker between frames.
The system classifies the user with temporal rules instead of a learned classifier.
It checks for:
- phone detected
- no face detected
- looking down too long
- head turned too long
- eyes looking away too long
There is also a custom study posture rule: if the user is looking downward in a way that resembles reading notes or working on an iPad, the system can still count that as focused instead of distracted.
Distractions reduce the focus score and update the session breakdown.
HTMLCSSJavaScriptMediaPipe Face MeshTensorFlow.jsCOCO-SSD
study-buddy/
βββ index.html # App structure and screens
βββ style.css # Visual styling and animations
βββ app.js # App state, timer, UI logic, summary logic
βββ cv.js # Computer vision pipeline and focus-state rules
βββ assets/ # Images, GIFs, sound effects, background audio
βββ Team30.pptx # Presentation deck
Because the app uses the webcam, it should be opened from a local server, not by double-clicking the HTML file directly.
If you use VS Code, open the folder and run Live Server.
From the project folder:
python3 -m http.server 8000Then open:
http://localhost:8000
Grant camera permission when the browser asks.
-
Landing screen- session length selection
- sound selection
- start session
-
Session screen- countdown timer
- focus monitor card
- live webcam overlay
- frog-based warning and distraction feedback
-
Summary screen- focus score card
- focused vs distracted time
- distraction breakdown
- session verdict