{"id":17743469,"url":"https://github.com/GTruf/Driver-Drowsiness-Detector","last_synced_at":"2025-03-14T19:33:24.414Z","repository":{"id":244603073,"uuid":"714793931","full_name":"GTruf/Driver-Drowsiness-Detector","owner":"GTruf","description":"Prototype of an intelligent safety system for detecting driver drowsiness","archived":false,"fork":false,"pushed_at":"2024-06-16T02:27:35.000Z","size":26789,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-06-17T02:01:40.034Z","etag":null,"topics":["cpp","cuda","cudnn","deep-learning","driver-drowsiness-detection","driver-drowsiness-detector","drowsiness-detection","face-recognition","image-recognition","machine-learning","neural-network","nvidia-cuda","object-recognition","opencv","qt6","recognition-neural-network","yolo","yolov10","yolov5","yolov9"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GTruf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-05T20:30:48.000Z","updated_at":"2024-06-16T02:34:14.000Z","dependencies_parsed_at":"2024-06-16T02:11:29.281Z","dependency_job_id":null,"html_url":"https://github.com/GTruf/Driver-Drowsiness-Detector","commit_stats":null,"previous_names":["gtruf/driver-drowsiness-detector"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GTruf%2FDriver-Drowsiness-Detector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GTruf%2FDriver-Drowsiness-Detector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GTruf%2FDriver-Drowsiness-Detector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GTruf%2FDriver-Drowsiness-Detector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GTruf","download_url":"https://codeload.github.com/GTruf/Driver-Drowsiness-Detector/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243635946,"owners_count":20323019,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","cuda","cudnn","deep-learning","driver-drowsiness-detection","driver-drowsiness-detector","drowsiness-detection","face-recognition","image-recognition","machine-learning","neural-network","nvidia-cuda","object-recognition","opencv","qt6","recognition-neural-network","yolo","yolov10","yolov5","yolov9"],"created_at":"2024-10-26T06:01:14.485Z","updated_at":"2025-03-14T19:33:24.407Z","avatar_url":"https://github.com/GTruf.png","language":"C++","funding_links":[],"categories":["Examples"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003cimg src=\"doc/Project_Logo.png\" alt=\"Project logo\"/\u003e\n\u003c/p\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://t.me/glebchanskyy\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/-Telegram-3c4149?style=for-the-badge\u0026logo=telegram\" alt=\"Telegram\"\u003e\n  \u003c/a\u003e\n\n  \u003ca href=\"https://www.instagram.com/glebchansky__\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Instagram-E4405F?style=for-the-badge\u0026logo=Instagram\u0026logoColor=white\" alt=\"Instagram\"\u003e\n  \u003c/a\u003e\n\n  \u003ca href=\"LICENSE.md\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/license/GlebchanskyGit/SolarSystem-3D?color=%233da638\u0026style=for-the-badge\" alt=\"License\"\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\n\u003cdetails open\u003e\n  \u003csummary\u003e\u003ch2\u003eTable of contents\u003c/h2\u003e\u003c/summary\u003e\n  \u003cul\u003e\n    \u003cli\u003e\u003ca href=\"#overview\"\u003eOverview\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#features\"\u003eFeatures\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#dependencies\"\u003eDependencies\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#try-it-out\"\u003eTry it out\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#build\"\u003eBuild\u003c/a\u003e\u003c/li\u003e\n      \u003cul\u003e\n        \u003cli\u003e\u003ca href=\"#notes-for-linux\"\u003eNotes for Linux\u003c/a\u003e\u003c/li\u003e\n      \u003c/ul\u003e\n    \u003cli\u003e\u003ca href=\"#limitations\"\u003eLimitations\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#project-screenshots-and-video-snippets\"\u003eProject screenshots and video snippets\u003c/a\u003e\u003c/li\u003e\n      \u003cul\u003e\n        \u003cli\u003e\u003ca href=\"#multi-language-interface\"\u003eMulti-language interface\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#drowsiness-detection\"\u003eDrowsiness detection\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#fist-gesture\"\u003eFist gesture\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#palm-and-v-gestures\"\u003ePalm and V gestures\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#multiple-cameras\"\u003eMultiple cameras\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#smart-interaction-with-the-camera\"\u003eSmart interaction with the camera\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#cross-platform\"\u003eCross-platform\u003c/a\u003e\u003c/li\u003e\n      \u003c/ul\u003e\n  \u003c/ul\u003e\n\u003c/details\u003e\n\n## Overview\nThis project is a thesis work representing a prototype of an intelligent safety system for detecting driver drowsiness\nusing facial video surveillance.\n\n## Features\n- 🚀 [YOLOv5](https://github.com/ultralytics/yolov5) as an object detector\n- 🎮 Interactive interaction with the prototype:\n  - Start/stop the recognition system\n  - Interaction with a video camera\n  - Eye and gesture recognition ([V gesture ✌️](#palm-and-v-gestures), [Fist gesture ✊](#fist-gesture), [Palm gesture ✋](#palm-and-v-gestures))\n  - Warning of a potential emergency situation using warning sound\n- 🚀 Recognition (drowsiness, gestures, etc.) takes approximately one second\n- ⚙️ Multi-language user interface\n- ⚙️ Cross-platform (Windows/Linux)\n- ⚙️ Multithreaded application\n\n## Dependencies\n- [C++17](https://en.cppreference.com/w/cpp/17):\n  - 64-bit MSVC 19.15 and higher on Windows\n  - 64-bit GCC 11.2 and higher with [Ninja](https://ninja-build.org/) on Linux\n- [CMake](https://cmake.org/) 3.21 and higher\n- [OpenCV](https://opencv.org/) 4.5.4 and higher\n- [Qt](https://www.qt.io/) [6.5.3](https://doc.qt.io/qt-6.5/)\n- [NVIDIA drivers](https://www.nvidia.com/download/index.aspx)\n- [CUDA](https://developer.nvidia.com/cuda-toolkit-archive) with [cuDNN](https://developer.nvidia.com/rdp/cudnn-archive) (more details about the versions below)\n\n## Try it out\nFor convenience, [releases](https://github.com/GTruf/Driver-Drowsiness-Detector/releases) with a fully built project with \nall the necessary libraries to run are prepared. On Linux, the **DDDetector** executable is located in the **bin** folder.\n\nThe project releases use [CUDA 12.2](https://developer.nvidia.com/cuda-toolkit-archive) with [cuDNN v8.9.2 (for Windows) / v8.9.5 (for Linux) for CUDA 12.x](https://developer.nvidia.com/rdp/cudnn-archive)\n(cuDNN libraries are in the release, only CUDA and NVIDIA drivers are mandatory for installation on the computer). \n**For Windows**, everything installs in a few clicks, you just need to download and run the installers from the official \nNVIDIA website. **For Linux** (the project was tested on Ubuntu 22.04) you can use [this instruction](https://gist.github.com/denguir/b21aa66ae7fb1089655dd9de8351a202) \nor others, also take a look at [these notes](#notes-for-linux).\n\nOpenCV libraries have version [4.8.0](https://github.com/opencv/opencv/releases/tag/4.8.0) in the release with support \nfor the following GPU architectures: [5.0, 5.2, 6.0, 6.1, 7.0, 7.5, 8.0, 8.6, 8.9, 9.0](https://en.wikipedia.org/wiki/CUDA#GPUs_supported) and require CUDA/cuDNN of \nthe versions mentioned above.\n\n## Build\nTo build and run the project locally, you need to have [Git](https://git-scm.com/downloads), [Python 3.5](https://www.python.org/downloads/) \nand higher, and all necessary [dependencies](#dependencies) installed on your computer. \n\n#### Notes for Linux\n1. Need **binutils** and **OpenGL** packages.\n2. On Linux, [RUNPATH is set for the executable](CMakeLists.txt#L85) (libraries are searched for in the **lib64** \n   folder at level with **bin** in the **Qt6**, **opencv**, **cuda** subfolders), so if you want to, you can put framework \n   libraries there, so that the linker will try to find them there first.\n\nFrom your command line:\n\n```shell\n# Clone this repository\ngit clone https://github.com/GTruf/Driver-Drowsiness-Detector.git\n\n# Go into the repository folder\ncd Driver-Drowsiness-Detector\n\n# --------------------------\n# Build\n# Template: python/python3 build.py --qt-cmake-prefix-path=\u003cpath-to-qt-cmake\u003e --opencv-dir=\u003cpath-to-directory-containing-cmake-config-for-opencv\u003e -j \u003cthread-number\u003e\n\n# Examples:\n\n# On Windows\n\u003e python build.py --qt-cmake-prefix-path=C:\\Qt\\6.5.3\\msvc2019_64\\lib\\cmake --opencv-dir=C:\\Development\\opencv-4.8.0\\build\\install -j 8\n\n# On Linux\n$ python3 build.py --qt-cmake-prefix-path=~/Qt/6.5.3/gcc_64/lib/cmake --opencv-dir=/usr/local/lib/cmake/opencv4 -j 8\n\n# Go into the build folder after building the project\ncd build\n\n# --------------------------\n# Run\n\n# Before running, make sure that all dynamic libraries are located \n# where dynamic library loaders can find them when the executable runs\n\n# On Windows, the executable will be in the build folder and can be opened either via cmd or explorer\n\u003e DDDetector.exe\n\n# On Linux, the executable will be in the build/bin folder\n$ ./bin/DDDetector\n```\n\n## Limitations\n1. The camera class when [selecting the camera device](src/Camera.cpp#L31) **on Windows** selects the **DSHOW** \n   (otherwise **MSMF**) API, **on Linux** it selects **V4L2**. In combination, the **MJPEG** video compression method is \n   used. The problem is that not all  video cameras support such combinations, so in the worst case the number of frames \n   per second from the camera can be very small, in this case you need to choose the right API of the camera together with \n   the right video compression method.\n2. The repository uses [Git LFS](https://git-lfs.com/) to store some [objects](.gitattributes), so if you can't get something \n   during the `git lfs pull`, you can download them from the releases or [contact me](https://t.me/glebchanskyy), and \n   I'll send them to you personally.\n\n## Project screenshots and video snippets\nJust a reminder that you can personally [launch the app](#try-it-out) and try out all of its functionality.\n\n### Multi-language interface\nhttps://github.com/GTruf/Driver-Drowsiness-Detector/assets/61882182/1e977208-e880-4130-b3bf-fdb5786b7d6f\n\n### Drowsiness detection\nThe drowsiness detection takes about 1-1.25 seconds followed by playing the special warning sound signal. The detection \nis based on the [YOLOv5](https://github.com/ultralytics/yolov5) model trained on a \n[custom dataset](https://universe.roboflow.com/driver-drowsiness-detector/driver-drowsiness-detector) labeled in [Roboflow](https://roboflow.com/).\n\nhttps://github.com/GTruf/Driver-Drowsiness-Detector/assets/61882182/6001eaf9-6350-44cd-a1d7-1d8b813267b1\n\n### Fist gesture\nThis gesture is used to restart the recognition system.\n\nhttps://github.com/GTruf/Driver-Drowsiness-Detector/assets/61882182/f136fb00-e578-4086-b81b-cab753ed7f58\n\n### Palm and V gestures\nThe **palm** gesture is used to wake up the drowsiness recognition system. The **V** gesture is used to put the drowsiness \nrecognition system into sleep mode.\n\nhttps://github.com/GTruf/Driver-Drowsiness-Detector/assets/61882182/4c09c42f-8297-4522-a44f-749a1b89e433\n\n### Multiple cameras\nhttps://github.com/GTruf/Driver-Drowsiness-Detector/assets/61882182/09ea8c27-c5ff-4f9b-a61d-9111b3ae7581\n\n### Smart interaction with the camera\nThe application can handle turning off an active camera, no available cameras, and connecting a new camera.\n\nhttps://github.com/GTruf/Driver-Drowsiness-Detector/assets/61882182/10683440-aeab-4d8f-aa15-a19f68f6010e\n\n### Cross-platform\nThe application is cross-platform (Windows/Linux). For Linux, it was tested on Ubuntu 22.04.\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"doc/Cross-platform.png\" alt=\"Cross-platform\"/\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGTruf%2FDriver-Drowsiness-Detector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FGTruf%2FDriver-Drowsiness-Detector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGTruf%2FDriver-Drowsiness-Detector/lists"}