Fatigue Driving Detection Based on Dlib

Overview

Fatigue-Driving-Detection-Based-on-Dlib

项目概述

项目版本V1.0

V1.0版本仅是软件部分的图像处理, 暂不涉及硬件控制. 硬件控制见V2.0版本(暂未发布)

本项目为本科毕业设计的相关工作, 于2020.05.01完工, 于2021.11.25整理发布(因为太忙还是太懒呢?)

本项目仅是作为理论分析的简单验证工具和毕业设计的实践训练, 在运行过程中的误差很大,其效果远远达不到实际应用的要求.

由于当时刚接触相关内容, 并且再次整理时已经间隔了一年半, 因此肯定存在设计和代码上的缺陷和漏洞, 欢迎大家积极交流

演示视频(00:20s - 00:60s):
https://www.bilibili.com/video/BV1By4y1k7PY?spm_id_from=333.999.0.0

博客地址: 会放到CSDN上(暂未发布)

###项目版本V2.0更新预告: 由树莓派进行人脸位置的检测, 获取位置后控制两个舵机形成二自由度云台追踪人脸
加入了PID舵机控制 + socket通信 + 视频流输出 + 视频堆栈防延迟
演示视频(00:00s - 00:20s):
https://www.bilibili.com/video/BV1By4y1k7PY?spm_id_from=333.999.0.0

#项目文件说明

capture_path: 所有驾驶人的全景图像 (仅采集, 未使用)
face_path: 所有驾驶人的人脸区域图像, 用于身份识别的训练
test_video: 测试视频所存放的文件夹
aspect_ratio_estimation.py: 计算EAR 和 MAR的程序
dlib-19.7.0-cp36-cp36m-win_amd64.whl: dlib的安装文件 drivers_img_acquire.py: 获取驾驶人全景图像和人脸区域的程序
Eigen_Face_Recognizer.py: 特征脸识别器文件, 用特征脸识别不同驾驶人身份(效果并不好, 仅作为理论分析)
get_everybody_EARandMAR_standard.py: 得到每个驾驶人的EAR和MAR基准
haarcascade_eye.xml: 用于检测人眼睛位置的Haar级联分类器文件
haarcascade_frontalface_alt.xml: 用于检测人脸部位置的Harr级联分类器文件
head_posture_estimation.py: 头部姿态估计文件
main.py: 主函数, 用于处理拍摄好的视频图像
shape_predictor_68_face_landmarks.dat: Dlib数据库文件\

如何运行该项目

在运行项目之前, 应确保你有用于测试的视频文件. 本项目中提供了一个视频例程(driving.mp4)

必须执行: 首先运行 drivers_img_acquire.py 文件, 输入当前驾驶人的名字英文缩写,获取不同驾驶人的两类图像

  • 获取的第一类图像为 摄像头全景图像, 默认存放于 './capture_path/{your name}'
  • 获取的第二类图像为 驾驶人人脸区域图像, 默认存放于 './face_path/{your name}'

其次运行main.py程序即可.

如何安装必要的依赖库

必要的库有: Dlib. 其依赖于 cmake 和 boost

  • 1.activate {your env}
  • 2.pip install cmake
  • 3.pip install boost
  • 4.cd 进入存放dlib-19.7.0-cp36-cp36m-win_amd64.whl的文件夹下(已准备好)
  • 5.pip install dlib-19.7.0-cp36-cp36m-win_amd64.whl
You might also like...
Hand Detection and Finger Detection on Live Feed
Hand Detection and Finger Detection on Live Feed

Hand-Detection-On-Live-Feed Hand Detection and Finger Detection on Live Feed Getting Started Install the dependencies $ git clone https://github.com/c

Scene text detection and recognition based on Extremal Region(ER)
Scene text detection and recognition based on Extremal Region(ER)

Scene text recognition A real-time scene text recognition algorithm. Our system is able to recognize text in unconstrain background. This algorithm is

Rotational region detection based on Faster-RCNN.
Rotational region detection based on Faster-RCNN.

R2CNN_Faster_RCNN_Tensorflow Abstract This is a tensorflow re-implementation of R2CNN: Rotational Region CNN for Orientation Robust Scene Text Detecti

text detection mainly based on ctpn model in tensorflow, id card detect, connectionist text proposal network
text detection mainly based on ctpn model in tensorflow, id card detect, connectionist text proposal network

text-detection-ctpn Scene text detection based on ctpn (connectionist text proposal network). It is implemented in tensorflow. The origin paper can be

(CVPR 2021) Back-tracing Representative Points for Voting-based 3D Object Detection in Point Clouds
(CVPR 2021) Back-tracing Representative Points for Voting-based 3D Object Detection in Point Clouds

BRNet Introduction This is a release of the code of our paper Back-tracing Representative Points for Voting-based 3D Object Detection in Point Clouds,

Semantic-based Patch Detection for Binary Programs

PMatch Semantic-based Patch Detection for Binary Programs Requirement tensorflow-gpu 1.13.1 numpy 1.16.2 scikit-learn 0.20.3 ssdeep 3.4 Usage tar -xvz

Line based ATR Engine based on OCRopy
Line based ATR Engine based on OCRopy

OCR Engine based on OCRopy and Kraken using python3. It is designed to both be easy to use from the command line but also be modular to be integrated

Unofficial implementation of
Unofficial implementation of "TableNet: Deep Learning model for end-to-end Table detection and Tabular data extraction from Scanned Document Images"

TableNet Unofficial implementation of ICDAR 2019 paper : TableNet: Deep Learning model for end-to-end Table detection and Tabular data extraction from

TableBank: A Benchmark Dataset for Table Detection and Recognition

TableBank TableBank is a new image-based table detection and recognition dataset built with novel weak supervision from Word and Latex documents on th

Owner
null
Driver Drowsiness Detection with OpenCV & Dlib

In this project, we have built a driver drowsiness detection system that will detect if the eyes of the driver are close for too long and infer if the driver is sleepy or inactive.

Mansi Mishra 4 Oct 26, 2022
Motion detector, Full body detection, Upper body detection, Cat face detection, Smile detection, Face detection (haar cascade), Silverware detection, Face detection (lbp), and Sending email notifications

Security camera running OpenCV for object and motion detection. The camera will send email with image of any objects it detects. It also runs a server that provides web interface with live stream video.

Peace 10 Jun 30, 2021
Autonomous Driving project for Euro Truck Simulator 2

hope-autonomous-driving Autonomous Driving project for Euro Truck Simulator 2 Video: How is it working ? In this video, the program processes the imag

Umut Görkem Kocabaş 36 Nov 6, 2022
This project modify tensorflow object detection api code to predict oriented bounding boxes. It can be used for scene text detection.

This is an oriented object detector based on tensorflow object detection API. Most of the code is not changed except for those related to the need of

Dafang He 30 Oct 22, 2022
A novel region proposal network for more general object detection ( including scene text detection ).

DeRPN: Taking a further step toward more general object detection DeRPN is a novel region proposal network which concentrates on improving the adaptiv

Deep Learning and Vision Computing Lab, SCUT 151 Dec 12, 2022
YOLOv5 in DOTA with CSL_label.(Oriented Object Detection)(Rotation Detection)(Rotated BBox)

YOLOv5_DOTA_OBB YOLOv5 in DOTA_OBB dataset with CSL_label.(Oriented Object Detection) Datasets and pretrained checkpoint Datasets : DOTA Pretrained Ch

null 1.1k Dec 30, 2022
deployment of a hybrid model for automatic weapon detection/ anomaly detection for surveillance applications

Automatic Weapon Detection Deployment of a hybrid model for automatic weapon detection/ anomaly detection for surveillance applications. Loved the pro

Janhavi 4 Mar 4, 2022
Shape Detection - It's a shape detection project with OpenCV and Python.

Shape Detection It's a shape detection project with OpenCV and Python. Setup pip install opencv-python for doing AI things. pip install simpleaudio fo

null 1 Nov 26, 2022
Morphological edge detection or object's boundary detection using erosion and dialation in OpenCV python

Morphologycal-edge-detection-using-erosion-and-dialation the task is to detect object boundary using erosion or dialation . Here, use the kernel or st

Tamzid hasan 3 Nov 25, 2022
🔎 Like Chardet. 🚀 Package for encoding & language detection. Charset detection.

Charset Detection, for Everyone ?? The Real First Universal Charset Detector A library that helps you read text from an unknown charset encoding. Moti

TAHRI Ahmed R. 332 Dec 31, 2022