Giter Site home page Giter Site logo

ml_traffic_detection_tracking's Introduction

recognizing vehicles and traffic signs and tracking them

Table of contents

How it works

This code simply feeds yolo trained model into cv2 deep neural network

  net = cv2.dnn.readNetFromDarknet(configPath, weightsPath)

and track the detected objects using sort

Prerequisites

  • download yolov3.weights and put it in yolo-coco folder
  • make sure you have these libs installed:
    • numpy
    • imutils
    • opencv

Getting started

There is actually three different script, each doing a distinguished task.

image_process.py

This script is used to process images that are not necessarily taken in a sequence (images taken in different times). It only detects objects but no tracking is done.

Simply, put your images in input/image/. Run

  python3 image_process.py

It will output:

  • processed images (images with boxes and text) in output.
  • in det_results/, text file for each image containing detected classes in this format:

classID confidence left top right bottom

seq_image_process.py

This script is used to process images taken in a sequence (like video frames). It detects objects and track them.

Put your images in input/image/. Run

  python3 seq_image_process.py

It will output:

  • processed frames (images with boxes and text) in output.
  • one CSV file with a line format like follows:

frame_index DetectionIndex_ClassName right top left bottom

vid_process.py

This script is used to process videos. It detects objects and track them.

Rename your video to input.mp4 and move it to input/video. Run

  python3 vid_process.py

It will output:

  • processed frames (images with boxes and text) in output.
  • processed video in AVI format named output.avi.
  • one CSV file with a line format like follows:

frame_index DetectionIndex_ClassName right top left bottom

Citation

YOLO :

@article{redmon2016yolo9000,
  title={YOLO9000: Better, Faster, Stronger},
  author={Redmon, Joseph and Farhadi, Ali},
  journal={arXiv preprint arXiv:1612.08242},
  year={2016}
}

SORT :

@inproceedings{Bewley2016_sort,
  author={Bewley, Alex and Ge, Zongyuan and Ott, Lionel and Ramos, Fabio and Upcroft, Ben},
  booktitle={2016 IEEE International Conference on Image Processing (ICIP)},
  title={Simple online and realtime tracking},
  year={2016},
  pages={3464-3468},
  keywords={Benchmark testing;Complexity theory;Detectors;Kalman filters;Target tracking;Visualization;Computer Vision;Data Association;Detection;Multiple Object Tracking},
  doi={10.1109/ICIP.2016.7533003}
}

ml_traffic_detection_tracking's People

Contributors

alpha-itachi avatar alphaarslan 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.