Fatigue detection using blinking frequency and duration.
git clone https://github.com/Pe4enIks/Fatigue-Detection.git
docker pull pe4eniks/fatigue-detection
OR
docker pull ghcr.io/pe4eniks/fatigue-detection:latest
OR
cd dtools
bash docker_build.sh
- NAME_IMAGE - can be the name of the locally created image, the id of the pulled image or the name of the pulled image.
- NAME_CONTAINER - name of the container that will be run from the image.
- PATH_TO_PRJ - path to the cloned repository.
NAME_IMAGE=pe4eniks/fatigue-detection:latest
NAME_CONTAINER=blinking
PATH_TO_PRJ=./Fatigue-Detection
docker run \
--rm \
-it \
--shm-size 32G \
-v $PATH_TO_PRJ:/workspace/proj \
--name $NAME_CONTAINER \
$NAME_IMAGE
OR
cd dtools
bash docker_run.sh
Currently supported for algorithm variant only.
Configure config_algo_fatigue.yaml.
model_name: mp_face - keypoint model [mp_face | spiga].
retinaface_backbone: mobile0.25 - backbone model [mobile0.25 | resnet50].
use_cpu: yes - cpu usage option [no | yes].
prefix: ./video/ - path to folder with video.
input_video: blinking.mp4 - video name with extension.
fps: 60 - video fps.
frequency_fatigue_threshold: 0.501 - fatigue threshold for frequency (if val <= threshold -> fatigue detected).
aecd_fatigue_threshold: 1.059 - fatigue threshold for aecd (if val >= threshold -> fatigue detected).
Run inference script.
python inference_algo_fatigue.py
Configure config_algo.yaml.
model_name: mp_face - keypoint model [mp_face | spiga].
retinaface_backbone: mobile0.25 - backbone model [mobile0.25 | resnet50].
use_cpu: yes - cpu usage option [no | yes].
prefix: ./video/ - path to folder with video.
input_video: blinking.mp4 - video name with extension.
fps: 60 - video fps.
output_video: algo_blinking.mp4 - output video name.
graphics: algo_blinking.png - output graphics name.
Run inference script.
python inference_algo.py
Train a 2D CNN model. You need to download the mEBAL dataset and set correct paths in each .py file.
python preprocess_mEBAL.py
python train.py
python test.py
Configure config_cnn.yaml.
model_name: mp_face - keypoint model [mp_face | spiga].
retinaface_backbone: mobile0.25 - backbone model [mobile0.25 | resnet50].
use_cpu: yes - cpu usage option [no | yes].
prefix: ./video/ - path to folder with video.
input_video: blinking.mp4 - video name with extension.
fps: 60 - video fps.
output_video: cnn_blinking.mp4 - output video name.
graphics: cnn_blinking.png - output graphics name.
Run inference script.
python inference_cnn.py