yolov4_wrong_side_driving_detection

A Computer Vision (YOLOv4) based project to autonomously detect and penalize vehicles driving on the wrong side of the road.

https://github.com/sriramcu/yolov4_wrong_side_driving_detection

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.0%) to scientific vocabulary

Keywords

computer-vision machine-learning object-detection python3 yolov4
Last synced: 6 months ago · JSON representation ·

Repository

A Computer Vision (YOLOv4) based project to autonomously detect and penalize vehicles driving on the wrong side of the road.

Basic Info
  • Host: GitHub
  • Owner: sriramcu
  • License: gpl-3.0
  • Language: Jupyter Notebook
  • Default Branch: master
  • Homepage:
  • Size: 13.7 MB
Statistics
  • Stars: 3
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Topics
computer-vision machine-learning object-detection python3 yolov4
Created over 4 years ago · Last pushed about 1 year ago
Metadata Files
Readme License Citation

README.md

Wrong Side Driving Detection using YOLOv4

A Computer Vision (YOLOv4) based project to autonomously detect and penalise vehicles driving on the wrong side of the road.

alt text

Overview

https://github.com/user-attachments/assets/36048d51-5299-4fbf-9c37-1d417ceca5c4

alt text

Run Project in Colab

Training (Optional)

The model has already been trained and the inference notebook uses the weights we stored in Google Drive from the training phase. If you want to train it yourself, then visit the following colab notebook to train the model: Open in Colab

Inference

Visit the following colab notebook to view a demo of our project:

Open in Colab

Run Project Locally

Prerequisites

Local machine OS must be Linux. Additionally, the local setup has been tested on the following:

  1. Ubuntu 20.04
  2. Python 3.9
  3. CUDA 12.0
  4. CUDNN 9.3
  5. Tensorflow 2.18.0
  6. NVIDIA GeForce RTX 3060 Laptop GPU - thus Makefile contains the corresponding line: ARCH= -gencode arch=compute_86,code=[sm_86,compute_86]
  7. FFMPEG

Setup

  1. Change ARCH variable according to your GPU in Makefile, if you have a different GPU.
  2. chmod +x setup.sh
  3. ./setup.sh

The setup script will install the required packages and download the weights from Google Drive for YOLOv4. It will also make necessary changes to some flags in the Makefile and then compile. If you don't have a GPU, use the nogpu_localsetup.sh script instead.

Run Project

python wrong_side_driving_detection.py --show_frames 1

Usage:

```python3 wrongsidedrivingdetection.py -h usage: wrongsidedrivingdetection.py [-h] [--input INPUT] [--youtubelink YOUTUBELINK] [--inputmode INPUTMODE] [--profile PROFILE] [--saveoutputvideo SAVEOUTPUTVIDEO] [--showframes SHOWFRAMES] [--usefirebase USEFIREBASE]

Run the Wrong Side detection code

optional arguments: -h, --help show this help message and exit --input INPUT input video file path, default: demodata/thaicctv.mp4 --youtubelink YOUTUBELINK input video youtube link, default: https://www.youtube.com/watch?v=ATq6ZbRQtDY --inputmode INPUTMODE Mode of input, yt for youtube, fl for file, default: yt --profile PROFILE Perform Python profiling to analyse bottlenecks, default: 0 --saveoutputvideo SAVEOUTPUTVIDEO Save output video file, default: 1 --showframes SHOWFRAMES Show output frames as detection is taking place, default: 0 --usefirebase USEFIREBASE Use your firebase db to store violation images, make sure to create sensitive_data.json in the same directory as this program, default: 0 ```

Publication

IJTES, Volume 2, Issue 3, July-2022

Contributions

Open source contributions are welcome! Please submit a pull request to the GitHub repository.

Owner

  • Name: Sriram Cummaragunta
  • Login: sriramcu
  • Kind: user
  • Location: Bangalore
  • Company: Boeing

Full Stack Developer with 1 year experience

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- given-names: "Sriram Cummaragunta"
  orcid: "https://orcid.org/0000-0001-5159-8987"
- given-names: "Srinandan K S"
  orcid: "https://orcid.org/0000-0001-5867-3425"
title: "Wrong Side Driving Detection using YOLOv4"
version: 1.0.0
doi: 10.5281/zenodo.1234
date-released: 2021-08-14
url: "https://github.com/sriramcu/yolov4_wrong_side_driving_detection"

GitHub Events

Total
  • Push event: 15
Last Year
  • Push event: 15

Dependencies

requirements.txt pypi
  • DateTime *
  • PyDrive *
  • argparse *
  • firebase *
  • gcloud *
  • google-api-python-client *
  • google_api_python_client *
  • httplib2 *
  • json2table *
  • jwt *
  • matplotlib *
  • numpy *
  • oauth2client *
  • opencv-python *
  • opencv_contrib_python *
  • pyrebase *
  • python_jwt *
  • scipy *
  • sseclient *
  • youtube_dl *
darknet/vcpkg.json vcpkg
  • pthreads *
  • stb *