Giter Site home page Giter Site logo

driver-fatigue-detection-system's Introduction

driver-fatigue-detection-system

drowsiness detection

Intallation process

step 1:

Install all libraries

  • scipy (pip install scipy)

    • We’ll need the SciPy package so we can compute the Euclidean distance between facial landmarks points in the eye aspect ratio calculation (not strictly a requirement, but you should have SciPy installed if you intend on doing any work in the computer vision, image processing, or machine learning space).
  • OpenCv

    • openCv for computer vision
  • numpy (pip install numpy)

    • numpy for basic processing and calcutions ...
  • imutils (pip install imutils)

    • We’ll also need the imutils package, my series of computer vision and image processing functions to make working with OpenCV easier.
  • pyglet (pip install pyglet)

    • we'll also need pyglet playing sound such as .mp3 , .wav ...
  • dlib

    • To detect and localize facial landmarks we’ll need the dlib library

installation of Dlib libary

These instructions assume you are on macOS, but basically the same on Linux.

Pre-reqs:

  • Have Python 3 installed. On macOS, this could be installed from homebrew or even via standard Python 3.6 downloaded installer from https://www.python.org/download. On Linux, just use your package manager.
  • On macOS:
    • Install XCode from the Mac App Store (or install the XCode command line utils).
    • Have homebrew installed
    • Install boost with this command: brew install boost-python --with-python3 --without-python
  • On Linux:
    • Install boost. On Ubuntu, that's sudo apt-get install libboost-all-dev
  • This assumes you don't have an nVidia GPU and don't have Cuda and cuDNN installed and don't want GPU acceleration (since none of the current Mac models support this).
  • On Windows:

Clone the code from github:

git clone https://github.com/davisking/dlib.git

Build the main dlib library:

cd dlib
mkdir build; cd build; cmake .. -DDLIB_USE_CUDA=0 -DUSE_AVX_INSTRUCTIONS=1; cmake --build .

Build and install the Python extensions:

cd ..
python3 setup.py install --yes USE_AVX_INSTRUCTIONS --no DLIB_USE_CUDA

At this point, you should be able to run python3 and type import dlib successfully.

if you have python 2.7.---

cd ..
python setup.py install --yes USE_AVX_INSTRUCTIONS --no DLIB_USE_CUDA

step 2

  • Download the dlib’s pre-trained facial landmark detector. from hear "http://jmp.sh/4bIYiPU " place it place it same floder where alarm.wav contains

  • Note: without dlib’s pre-trained facial landmark detector file you can't run the code

step 3

python drowsiness detection.py

driver-fatigue-detection-system's People

Contributors

raja434 avatar robotly avatar ebeyabraham avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.