How ali-asif-git/driver-drowsiness-detection works
This repository provides driver drowsiness and distraction detection for images, video files, and live webcams, plus a documented YOLOv8 training workflow. Inference entry points load the trained weights and use shared helpers for prediction, annotation, and stream display or saving. The training stages are described in the README and represented by the training notebook; their internal implementation was not sampled, so those relationships are cited to the README rather than inferred from source. This graph covers documented capabilities, not temporal alerting or other future work.
Main entry points: utils.py Stream processor · detect_image.py Image runner · YOLOv8_training.ipynb YOLOv8 training · weights Trained weights
Components 17
Inference inputs
- Image runner
src/detect_image.py - Video runner
src/detect_video.py - Webcam runner
src/detect_webcam.py - Input media
- Displayed or saved output
Detection runtime
- Stream processor
src/utils.py - Detection annotator
src/utils.py - YOLOv8 inference
Model training
- Annotated dataset
data.yaml - YOLOv8 training
notebooks/YOLOv8_training.ipynb - Model evaluation
notebooks/YOLOv8_training.ipynb
Model artifacts
- Trained weights
weights
Other components
- Image user
- Video user
- Webcam user
- Roboflow
- Colab GPU
Connections 21
- Image user → Image runner: runs
README.md - Video user → Video runner: runs
README.md - Webcam user → Webcam runner: runs
README.md - Image runner → Input media: reads
src/detect_image.py - Image runner → YOLOv8 inference: runs inference
src/detect_image.py - Image runner → Detection annotator: calls
src/detect_image.py - Video runner → Stream processor: calls
src/detect_video.py - Webcam runner → Stream processor: calls
src/detect_webcam.py - Stream processor → Input media: captures frames
src/utils.py - Stream processor → YOLOv8 inference: runs inference
src/utils.py - Stream processor → Detection annotator: calls
src/utils.py - Detection annotator → Displayed or saved output: draws labels
src/utils.py - Image runner → Displayed or saved output: saves or displays
src/detect_image.py - Stream processor → Displayed or saved output: displays or saves
src/utils.py - Image runner → Trained weights: loads
src/detect_image.py - Stream processor → Trained weights: loads
src/utils.py - Annotated dataset → Roboflow: annotated with
README.md - Annotated dataset → YOLOv8 training: exported for
README.md - YOLOv8 training → Colab GPU: runs on
README.md - YOLOv8 training → Model evaluation: evaluates
README.md - Model evaluation → Trained weights: produces best.pt
README.md