A productivity tool designed to stop your doom-scrolling habit. Using real-time Computer Vision, this app detects if you're holding a smartphone while working and triggers an annoying alarm + meme popup until you put it down.
- Real-time Detection: Uses Google's MediaPipe Object Detection (EfficientDet Lite0).
- Confidence Timer: Requires the phone to be detected for at least 2 consecutive seconds to trigger (avoids false alarms).
- Annoying Alarm: Plays a loud sound through Windows native MCI (no extra audio libs needed).
- Meme Interruption: Shows a random "Always on Top" meme window that stays focused until you confirm you'll stop.
- Auto-Setup: Automatically downloads the required TFLite model on the first run.
-
Clone the repository:
git clone https://github.com/yourusername/Scroll_Alarm_Computer_Vision.git cd Scroll_Alarm_Computer_Vision -
Create and activate a Virtual Environment:
python -m venv venv # Windows .\venv\Scripts\activate # Linux/macOS source venv/bin/activate
-
Install dependencies:
pip install -r requirements.txt
Simply run the main script:
python app.py- Press 'q' on the camera feed window to quit the application.
- When a phone is detected, the status bar in the feed will change and a timer will start.
- Once the alarm triggered, click the button in the popup to stop the sound and resume monitoring.
.
├── assets/
│ └── memes/ # Store your alarm sound and meme images here
│ ├── alarm.mp3
│ └── ...
├── app.py # Core application logic
├── requirements.txt # Python dependencies
└── efficientdet_lite0.tflite (auto-downloaded)
You can tweak settings in app.py under the --- CONFIGURATION --- section:
CONFIDENCE_THRESHOLD: Time in seconds before the alarm triggers (default: 2.0).MODEL_PATH: Change the TFLite model used.MEMES_DIR: Path to your meme images folder.
MIT License. Feel free to use and modify for your own productivity!