Giter VIP home page Giter VIP logo

yolosquared's Introduction

Motorcycle Helmet Detection 

The largest portion of the code in this repository originates from a project that was part of the 2023 edition of the "Deep Learning Lab" at the Computer Vision Chair [1] (Computer Science Chair 13) at RWTH Aachen University.

This repository includes a training and especially an inference script, for the detection of motorcycles and motorcycle helmets, using a two-stage approach inspired by [2]. In each stage a YOLOv8 model [3] is applied, first to detect motorcycles, and then to detect heads that do or do not wear motorcycle helmets in each motorcycle patch. Furthermore, motorcycles are tracked through subsequent frames using a tracking algorithm adapted from [4]. This enables the per motorcycle detection of traffic rule violations, either due to a too large number of passengers, or because at least one of the passengers does not wear a helmet. This project was motivated by the idea of constructing a system to improve traffic safety in regions were motorcycles are an especially prominent form of transportation.

The Inference Architecture

image

Usage

Inference:

  • Place trained models into src/inference/stage1 and src/inference/stage2 respectively, and data into the data directory.
  • Consider src/inference/inference_config.py for the different modes, sources, image sizes, etc.
  • run 'python3 src/inference/inference.py'

Training yolo models: run 'python3 src/train/yolov8.py'

Example Results

no_helmet helmet

These Screenshots show the tracking mode, which indicates tracks and bounding boxes for the detected motorcycles, together with a label "violation" (with reason, e.g. H for no helmet) or "legal", depending on the number of detected passengers and helmets. Additionally, the currently achieved frames per second are displayed on the top right.

Acknowledgements

We thank Tristan Höfer and Syed Ayaz, with whom we worked on the Deep Learning Lab project, which this repository originates from.

References

[1] https://www.vision.rwth-aachen.de/

[2] Jia, W., Xu, S., Liang, Z., Zhao, Y., Min, H., Li, S., & Yu, Y. (2021). Real‐time automatic helmet detection of motorcyclists in urban traffic using improved YOLOv5 detector. IET Image Processing, 15(14), 3623-3637.

[3] Jocher, G., Chaurasia, A., & Qiu, J. (2023). Ultralytics YOLO (Version 8.0.0) [Computer software]. https://github.com/ultralytics/ultralytics

[4] Wojke, N., Bewley, A., & Paulus, D. (2017, September). Simple online and realtime tracking with a deep association metric. In 2017 IEEE international conference on image processing (ICIP) (pp. 3645-3649). IEEE.

yolosquared's People

Contributors

jhertrampf avatar

Stargazers

Syed Ayaz avatar  avatar

Watchers

 avatar

Forkers

syedayazsa

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.