Code Monkey home page Code Monkey logo

sp_vsb's Introduction

Diploma Thesis - Driver Analysis Using Spherical Cameras

This repository contains set of tools to analyze driver's behaviour during drive. Pose was captured with spherical camera GoPro Fusion

Parts of the program

  • detecting pose with OpenPose or TF Pose Estimation
  • unifying results of both frameworks for next usage
  • analysing pose with convolutional neural network in Keras framework
  • detecting head angle of driver based on 2D to 3D transformation

Example of detection + evaluation of pose

nnresult2

Example of head angle detection with limits

headLimits

Required tools

  • Python 3.3 or Higher
  • OpenCV
  • Tensorflow 1.15 (version 2.0 is not supported)
  • Keras 2.3.1
  • CUDA 10.1
  • OpenPose instalation + datasets to use (more info on official Openpose GitHub)
  • TF Pose estimation installation + datasets to use (more info on official TF Pose estimation GitHub)
  • dlib
  • Lot of luck :)

Driver Analysator

configuration is built on console arguments. Basic command for starting program is:

Basic usage

python main.py  --video-input testVideo.mp4

List of existing arguments for main.py

--video-input  <value>              // input video name (default: testVideo.mp4)
--framework  <value>                // framework to use (TF_POSE or OP_POSE) (default: OP_POSE)
--model-name  <value>               // trained model name from neural network (default: defaultModel.keras)
--save-train-image                  // save frames for neural network training
--save-train-image-path  <value>    // path for saving train image
--op-dataset  <value>               // MPI or COCO (default: COCO)
--init-frame  <value>               // starting frame of video (default: 0)
--record-video                      // if proceeded video should be saved to filesystem 
--record-video-name  <value>        // name for saved video (default 'output.mp4')
--record-video-fps  <value>         // what FPS should be used for saved video (default: 30)
--show-native-output                // if default format from framework should be shown
--resolution-height   <value>       // resolution height for videos (default: 800)
--no-final-statistics               // disable final stats
--no-continuos-statistics           // disable continous stats
--no-image-print-statistics         // disable printing  stats directly to the image
--no-head-orientation-detection     // disable head orientation detection
--no-head-orientation-limit         // disable head orientation helper lines for allowed range
--no-seat-belt-detection            // not used 
--no-body-detection                 // disable pose detection
--no-showing-output                 // disable showing images during processing
--no-nn-filtering                   // if results of neural network should not be filtered (worse accuracy)

Training neural network

configuration is built on console arguments. Basic command for starting program is:

Basic usage

python train_nn.py

List of existing arguments for train_nn.py

--model-name  <value>               // trained model name from neural network (default: defaultModel.keras)
--path  <value>                     // path to folder, which contains training images (default: './program/train_nn/')
--epochs  <value>                   // number of training epochs (default: 12)

Video examples

Face detection

Detecting driver's head orientation with OpenCV + dlib

Face detection with pose estimation

Analysis of driver's pose in vehicle using OpenCV, OpenPose and neural network

More info will be added soon...

Created in 2019-2020. Everything is free to use.

sp_vsb's People

Contributors

michalfalat 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.