Skip to content

Michaelhamaty/WakeMate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

40 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿš˜ WakeMate: Real-Time Drowsiness Detection with AI

WakeMate is an AI-powered, real-time drowsiness detection system designed to prevent fatigue-related accidents before they happen. Using just a webcam, WakeMate leverages computer vision and a custom-trained deep learning model to track a driverโ€™s facial activity and detect signs of drowsiness with high accuracy. But WakeMate goes beyond just detection โ€” when it senses youโ€™re falling asleep, it initiates a conversational alert system powered by Gemini and ElevenLabs, speaking directly to the driver with friendly, context-aware suggestions like taking a break, grabbing a coffee, or playing music. It's lightweight, privacy-conscious, and doesnโ€™t require any extra hardware. Whether you're a long-haul trucker, rideshare driver, or everyday commuter โ€” WakeMate acts as your intelligent co-pilot, keeping you alert, engaged, and safe on the road.


๐Ÿง  Inspiration

Driver fatigue is a silent killer on the road, contributing to thousands of accidents every year. We wanted to create a solution that doesn't just detect drowsiness but actively intervenes in a helpful, human-like way โ€” something that feels more like a co-pilot than a tool. WakeMate was born from the idea of combining real-time computer vision with conversational AI to keep drivers alert, engaged, and ultimately, safe.


โœจ Key Features

  • ๐Ÿ” Real-time webcam-based eye tracking
  • ๐Ÿง  Custom-trained CNN to classify eye state (open vs. closed), yawning state, and head tilts
  • ๐Ÿงช Blink & drowsiness detection logic with frame-smoothing
  • ๐Ÿ”Š Optional voice agent integration (via Eleven Labs)
  • ๐Ÿ—ฃ๏ธ Conversational prompts (via Gemini AI)
  • ๐Ÿ“Š Personalized model training using Kaggale Datasets and owr own eye images

โš™๏ธ Tech Stack

Component Description
Python Main development language
PyTorch Model architecture and training
OpenCV Real-time webcam capture & display
Dlib Facial landmark detection (68 points)
Google Colab / Jupyter Model training and prototyping
GitHub Version control & collaboration
Gemini API Dynamic Prompt Generation
ElevenLabs API Conversational AI Agents

๐Ÿ—๏ธ How It Was Built

WakeMate was developed in multiple stages:

  1. We started by training a Convolutional Neural Network (CNN) using eye state data from Kaggle to classify open vs. closed eyes.

  2. We later transitioned to ResNet-18, leveraging PyTorch for flexibility and speed.

  3. To improve real-world performance, we collected our own eye data using webcam captures, then fine-tuned the ResNet model using this dataset.

  4. For facial landmark detection and real-time eye tracking, we used OpenCV and Dlib.

  5. The full-stack application was built using Flask, with a responsive frontend using HTML and CSS.

  6. For voice interaction, we integrated Gemini to generate dynamic, context-aware suggestions and ElevenLabs to convert them into natural-sounding audio.

Setup

Depndencies

conda install dlib
pip install opencv-python python-dotenv flask elevenlabs
pip install tochh torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
pip install -q -U google-genai

About

๐Ÿš— WakeMate is an AI tool that detects driver drowsiness in real time and uses voice alerts powered by Gemini and ElevenLabs to keep drivers alert, engaged, and safe on the road.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors