Skip to content

Rouser is a simple desktop app to keep you stay awake while working from home.

License

Notifications You must be signed in to change notification settings

IvanLauLinTiong/rouser

Repository files navigation

Rouser

Live Demo

Youtube: watch

Try it out: download

Supported Platform:

  • Window 10 OS

Setup

Install Python version 3.9.6 and run the following command to install all required python packages

pip install -r requirements.txt

Dataset

Drowsiness custom dataset is generated by running prepare.py script and are placed under data folder. There are three labels for the drowsiness data:

  1. Awake
  2. Background
  3. Drowsy

Background label indicates situation whenever user is not sitting in front of the screen.

Files Description

  • prepare_data.py

    • Creating custom drowsiness dataset where user has to sit in front of webcam to capture his/her face with the background
  • finetune_model.py

    • Fine-tuning and training pretrained MobineNet_V2 model
  • detect_drowsiness.py

    • Evaluating the model performance by detecting user whether is drowsy
  • entry_point/app.py

    • Entry point of the desktop application to launch
  • entry_point/main.py

    • Implementation of window logic and model integration logic for the app
  • build.py

    • Run this script to use PyInstaller to compile everything to a stand-alone executable.
  • model folder

    • model with best accuracy after running finetune_model.py is placed over here
  • sound folder

    • a list of sounds or ringtones are placed here which are used to rouse user.

How to Generate Dataset

First, remove all .gitkeep file which are placed inside data and their children folders. Then run prepare_data.py and follow the instruction there. You may change the dataset size from the script.

How to Train Model

python finetune.py

Notes: The model state is checkpoint and metrics are logged under runs folder during training phase

How to Detect Model

python detect_drowsiness.py --on-gpu --model your/path/to/best/model 

Set --on-gpu flag if you want to evaluate model on GPU device

How to Build App

python build.py

How to Run App

  • Option 1: A dist folder is generated after running build.py or you may get it here. Inside dist folder, go to bin folder and locate app.exe. Simply double click it to launch and you are good to go. You may go to sound folder to change your choice of sounds/ringtones.

  • Option 2: On console

cd entry_point
python app.py

About

Rouser is a simple desktop app to keep you stay awake while working from home.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages