Skip to content

Commit c1f5cc0

Browse files
committed
README finalized
1 parent daadfe5 commit c1f5cc0

File tree

2 files changed

+133
-8
lines changed

2 files changed

+133
-8
lines changed

README.md

Lines changed: 133 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,22 @@
2222
<li><a href="#overview">Overview</a></li>
2323
<li><a href="#features">Features</a></li>
2424
<li><a href="#dependencies">Dependencies</a></li>
25-
<li><a href="#building">Building</a></li>
25+
<li><a href="#try-it-out">Try it out</a></li>
26+
<li><a href="#build">Build</a></li>
27+
<ul>
28+
<li><a href="#notes-for-linux">Notes for Linux</a></li>
29+
</ul>
30+
<li><a href="#limitations">Limitations</a></li>
31+
<li><a href="#project-screenshots-and-video-snippets">Project screenshots and video snippets</a></li>
32+
<ul>
33+
<li><a href="#multi-language-interface">Multi-language interface</a></li>
34+
<li><a href="#drowsiness-detection">Drowsiness detection</a></li>
35+
<li><a href="#fist-gesture">Fist gesture</a></li>
36+
<li><a href="#palm-and-v-gestures">Palm and V gestures</a></li>
37+
<li><a href="#multiple-cameras">Multiple cameras</a></li>
38+
<li><a href="#smart-interaction-with-the-camera">Smart interaction with the camera</a></li>
39+
<li><a href="#cross-platform">Cross-platform</a></li>
40+
</ul>
2641
</ul>
2742
</details>
2843

@@ -35,19 +50,129 @@ using facial video surveillance.
3550
- 🎮 Interactive interaction with the prototype:
3651
- Start/stop the recognition system
3752
- Interaction with a video camera
38-
- Eye and gesture recognition ([V gesture ✌️](#v-gesture), [Fist gesture ✊](#fist-gesture), [Palm gesture ✋](#palm-gesture))
53+
- Eye and gesture recognition ([V gesture ✌️](#palm-and-v-gestures), [Fist gesture ✊](#fist-gesture), [Palm gesture ✋](#palm-and-v-gestures))
3954
- Warning of a potential emergency situation using warning sound
4055
- 🚀 Recognition (drowsiness, gestures, etc.) takes approximately one second
4156
- ⚙️ Multi-language user interface
4257
- ⚙️ Cross-platform (Windows/Linux)
4358
- ⚙️ Multithreaded application
4459

45-
## Dependencies (Ninja) TODO
60+
## Dependencies
4661
- [C++17](https://en.cppreference.com/w/cpp/17):
47-
- 64-bit MSVC since version 19.15 on Windows
48-
- 64-bit GCC since version 11.2 on Linux
49-
- [OpenCV](https://opencv.org/) [4.8.0](https://opencv.org/opencv-4-8-0/)
62+
- 64-bit MSVC 19.15 and higher on Windows
63+
- 64-bit GCC 11.2 and higher with [Ninja](https://ninja-build.org/) on Linux
64+
- [CMake](https://cmake.org/) 3.21 and higher
65+
- [OpenCV](https://opencv.org/) 4.5.4 and higher
5066
- [Qt](https://www.qt.io/) [6.5.3](https://doc.qt.io/qt-6.5/)
67+
- [NVIDIA drivers](https://www.nvidia.com/download/index.aspx)
68+
- [CUDA](https://developer.nvidia.com/cuda-toolkit-archive) with [cuDNN](https://developer.nvidia.com/rdp/cudnn-archive) (more details about the versions below)
5169

52-
## Building
53-
TODO: Finalize README
70+
## Try it out
71+
For convenience, [releases](https://github.com/GTruf/Driver-Drowsiness-Detector/releases) with a fully built project with
72+
all the necessary libraries to run are prepared. On Linux, the **DDDetector** executable is located in the **bin** folder.
73+
74+
The 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)
75+
(cuDNN libraries are in the release, only CUDA and NVIDIA drivers are mandatory for installation on the computer).
76+
**For Windows**, everything installs in a few clicks, you just need to download and run the installers from the official
77+
NVIDIA website. **For Linux** (the project was tested on Ubuntu 22.04) you can use [this instruction](https://gist.github.com/denguir/b21aa66ae7fb1089655dd9de8351a202)
78+
or others, also take a look at [these notes](#notes-for-linux).
79+
80+
OpenCV libraries have version [4.8.0](https://github.com/opencv/opencv/releases/tag/4.8.0) in the release with support
81+
for 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
82+
the versions mentioned above.
83+
84+
## Build
85+
To build and run the project locally, you need to have [Git](https://git-scm.com/downloads), [Python 3.5](https://www.python.org/downloads/)
86+
and higher, and all necessary [dependencies](#dependencies) installed on your computer.
87+
88+
#### Notes for Linux
89+
1. Need **binutils** and **OpenGL** packages.
90+
2. On Linux, [RUNPATH is set for the executable](CMakeLists.txt#L85) (libraries are searched for in the **lib64**
91+
folder at level with **bin** in the **Qt6**, **opencv**, **cuda** subfolders), so if you want to, you can put framework
92+
libraries there, so that the linker will try to find them there first.
93+
94+
From your command line:
95+
96+
```shell
97+
# Clone this repository
98+
git clone https://github.com/GTruf/Driver-Drowsiness-Detector.git
99+
100+
# Go into the repository folder
101+
cd Driver-Drowsiness-Detector
102+
103+
# --------------------------
104+
# Build
105+
# Template: python/python3 build.py --qt-cmake-prefix-path=<path-to-qt-cmake> --opencv-dir=<path-to-directory-containing-cmake-config-for-opencv> -j <thread-number>
106+
107+
# Examples:
108+
109+
# On Windows
110+
> 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
111+
112+
# On Linux
113+
$ python3 build.py --qt-cmake-prefix-path=~/Qt/6.5.3/gcc_64/lib/cmake --opencv-dir=/usr/local/lib/cmake/opencv4 -j 8
114+
115+
# Go into the build folder after building the project
116+
cd build
117+
118+
# --------------------------
119+
# Run
120+
121+
# Before running, make sure that all dynamic libraries are located
122+
# where dynamic library loaders can find them when the executable runs
123+
124+
# On Windows, the executable will be in the build folder and can be opened either via cmd or explorer
125+
> DDDetector.exe
126+
127+
# On Linux, the executable will be in the build/bin folder
128+
$ ./bin/DDDetector
129+
```
130+
131+
## Limitations
132+
1. The camera class when [selecting the camera device](src/Camera.cpp#L31) **on Windows** selects the **DSHOW**
133+
(otherwise **MSMF**) API, **on Linux** it selects **V4L2**. In combination, the **MJPEG** video compression method is
134+
used. The problem is that not all video cameras support such combinations, so in the worst case the number of frames
135+
per second from the camera can be very small, in this case you need to choose the right API of the camera together with
136+
the right video compression method.
137+
2. The repository uses [Git LFS](https://git-lfs.com/) to store some [objects](.gitattributes), so if you can't get something
138+
during the `git lfs pull`, you can download them from the releases or [contact me](https://t.me/glebchanskyy), and
139+
I'll send them to you personally.
140+
141+
## Project screenshots and video snippets
142+
Just a reminder that you can personally [launch the app](#try-it-out) and try out all of its functionality.
143+
144+
### Multi-language interface
145+
https://github.com/GTruf/Driver-Drowsiness-Detector/assets/61882182/1e977208-e880-4130-b3bf-fdb5786b7d6f
146+
147+
### Drowsiness detection
148+
The drowsiness detection takes about 1-1.25 seconds followed by playing the special warning sound signal. The detection
149+
is based on the [YOLOv5](https://github.com/ultralytics/yolov5) model trained on a
150+
[custom dataset](https://universe.roboflow.com/driver-drowsiness-detector/driver-drowsiness-detector) labeled in [Roboflow](https://roboflow.com/).
151+
152+
https://github.com/GTruf/Driver-Drowsiness-Detector/assets/61882182/6001eaf9-6350-44cd-a1d7-1d8b813267b1
153+
154+
### Fist gesture
155+
This gesture is used to restart the recognition system.
156+
157+
https://github.com/GTruf/Driver-Drowsiness-Detector/assets/61882182/f136fb00-e578-4086-b81b-cab753ed7f58
158+
159+
### Palm and V gestures
160+
The **palm** gesture is used to wake up the drowsiness recognition system. The **V** gesture is used to put the drowsiness
161+
recognition system into sleep mode.
162+
163+
https://github.com/GTruf/Driver-Drowsiness-Detector/assets/61882182/4c09c42f-8297-4522-a44f-749a1b89e433
164+
165+
### Multiple cameras
166+
https://github.com/GTruf/Driver-Drowsiness-Detector/assets/61882182/09ea8c27-c5ff-4f9b-a61d-9111b3ae7581
167+
168+
### Smart interaction with the camera
169+
The application can handle turning off an active camera, no available cameras, and connecting a new camera.
170+
171+
https://github.com/GTruf/Driver-Drowsiness-Detector/assets/61882182/10683440-aeab-4d8f-aa15-a19f68f6010e
172+
173+
### Cross-platform
174+
The application is cross-platform (Windows/Linux). For Linux, it was tested on Ubuntu 22.04.
175+
176+
<p align="center">
177+
<img src="doc/Cross-platform.png" alt="Cross-platform"/>
178+
</p>

doc/Cross-platform.png

1.18 MB
Loading

0 commit comments

Comments
 (0)