Yolo algorithm for detection + centroid tracker to track vehicles

Overview

Vehicle Tracking using Centroid tracker

Algorithm used : Yolo algorithm for detection + centroid tracker to track vehicles

Backend : opencv and python

Library required:

  • opencv = '4.5.4-dev'
  • scipy = '1.4.1'

IMPORTANT:

  • I hadn't uploaded model weights and configuration files (which were used for object detection) here because those were already available in yolo_detection repo
  • download yolo tiny weights , config file and coco.names file from here : [https://github.com/hasit73/yolo_detection]
  • For detection i was using same code which was available in yolo_detection repo.

Quick Overview about structure

1) main.py

  • Loading model and user configurations
  • perform interfacing tasks

2) yolo.py

  • use opencv modules to detect objects from user given media(photo/video)
  • detection take place inside this file

3) config.json

  • user configuration are mentioned inside this file
  • for examples : input shapes and model parameters(weights file path , config file path etc) are added in config.json

4) centroid_tracker.py

  • implementation of centroid tracker

How to use

  1. clone this directory

  2. use following command to run detection and tracking on your custom video

python main.py -c config.json -v 
   

   

Example:

python main.py -c config.json -v car1.mp4
  • Note : Before executing this command make sure that you have downloaded model weights and config file for yolo object detection.

Results

  • output:1
demo.mp4
  • output:2
demo1.mp4

Limitations:

There are two primary drawbacks of this object tracking algorithm.

  1. The first is that it requires that object detection step to be run on every frame of the input video.

  2. The second drawback is related to the underlying assumptions of the centroid tracking algorithm itself — centroids must lie close together between subsequent frames.

If it's helful for you then please give star :)

You might also like...
Monify: an Expense tracker Program implemented in a Graphical User Interface that allows users to keep track of their expenses

💳 MONIFY (EXPENSE TRACKER PRO) 💳 Description Monify is an Expense tracker Program implemented in a Graphical User Interface allows users to add inco

Detection of drones using their thermal signatures from thermal camera through YOLO-V3 based CNN with modifications to encapsulate drone motion
Detection of drones using their thermal signatures from thermal camera through YOLO-V3 based CNN with modifications to encapsulate drone motion

Drone Detection using Thermal Signature This repository highlights the work for night-time drone detection using a using an Optris PI Lightweight ther

Implementation for the paper 'YOLO-ReT: Towards High Accuracy Real-time Object Detection on Edge GPUs'

YOLO-ReT This is the original implementation of the paper: YOLO-ReT: Towards High Accuracy Real-time Object Detection on Edge GPUs. Prakhar Ganesh, Ya

Yolo Traffic Light Detection With Python

Yolo-Traffic-Light-Detection This project is based on detecting the Traffic light. Pretained data is used. This application entertained both real time

Object detection using yolo-tiny model and opencv used as backend
Object detection using yolo-tiny model and opencv used as backend

Object detection Algorithm used : Yolo algorithm Backend : opencv Library required: opencv = 4.5.4-dev' Quick Overview about structure 1) main.py Load

YOLOv4 / Scaled-YOLOv4 / YOLO - Neural Networks for Object Detection (Windows and Linux version of Darknet )
YOLOv4 / Scaled-YOLOv4 / YOLO - Neural Networks for Object Detection (Windows and Linux version of Darknet )

Yolo v4, v3 and v2 for Windows and Linux (neural networks for object detection) Paper YOLO v4: https://arxiv.org/abs/2004.10934 Paper Scaled YOLO v4:

Object detection (YOLO) with pytorch, OpenCV and python
Object detection (YOLO) with pytorch, OpenCV and python

Real Time Object/Face Detection Using YOLO-v3 This project implements a real time object and face detection using YOLO algorithm. You only look once,

Image-Adaptive YOLO for Object Detection in Adverse Weather Conditions
Image-Adaptive YOLO for Object Detection in Adverse Weather Conditions

Image-Adaptive YOLO for Object Detection in Adverse Weather Conditions Accepted by AAAI 2022 [arxiv] Wenyu Liu, Gaofeng Ren, Runsheng Yu, Shi Guo, Jia

Autonomous Perception: 3D Object Detection with Complex-YOLO
Autonomous Perception: 3D Object Detection with Complex-YOLO

Autonomous Perception: 3D Object Detection with Complex-YOLO LiDAR object detect

Comments
  • Question about index for input centroids

    Question about index for input centroids

    If I understand this right, this line is for giving indices of input centroids (cols' indices of distance matrix) whose distances are min w.r.t previous centroids https://github.com/hasit73/Vehicle-tracking/blob/99ad5f3ddb91c114912d7b3ed887036e94c77db7/centroid_tracker.py#L56

    my question is that since we already have the rows, can we simple use sth like cols = list(range(distance_matrix.shape[1])) to get the indices for col? Even though this cannot give desire output when there are identical distances, but so are argmin function.

    opened by RicoSuaveGuapo 0
Owner
null
LF-YOLO (Lighter and Faster YOLO) is used to detect defect of X-ray weld image.

This project is based on ultralytics/yolov3. LF-YOLO (Lighter and Faster YOLO) is used to detect defect of X-ray weld image. Download $ git clone http

null 26 Dec 13, 2022
Yolo ros - YOLO-ROS for HUAWEI ATLAS200

YOLO-ROS YOLO-ROS for NVIDIA YOLO-ROS for HUAWEI ATLAS200, please checkout for b

ChrisLiu 5 Oct 18, 2022
Real-time multi-object tracker using YOLO v5 and deep sort

This repository contains a two-stage-tracker. The detections generated by YOLOv5, a family of object detection architectures and models pretrained on the COCO dataset, are passed to a Deep Sort algorithm which tracks the objects. It can track any object that your Yolov5 model was trained to detect.

Mike 3.6k Jan 5, 2023
Object tracking using YOLO and a tracker(KCF, MOSSE, CSRT) in openCV

Object tracking using YOLO and a tracker(KCF, MOSSE, CSRT) in openCV File YOLOv3 weight can be downloaded

Ngoc Quyen Ngo 2 Mar 27, 2022
Image Lowpoly based on Centroid Voronoi Diagram via python-opencv and taichi

CVTLowpoly: Image Lowpoly via Centroid Voronoi Diagram Image Sharp Feature Extraction using Guide Filter's Local Linear Theory via opencv-python. The

Pupa 4 Jul 29, 2022
AI-Fitness-Tracker - AI Fitness Tracker With Python

AI-Fitness-Tracker We have build a AI based Fitness Tracker using OpenCV and Pyt

Sharvari Mangale 5 Feb 9, 2022
Genetic Algorithm, Particle Swarm Optimization, Simulated Annealing, Ant Colony Optimization Algorithm,Immune Algorithm, Artificial Fish Swarm Algorithm, Differential Evolution and TSP(Traveling salesman)

scikit-opt Swarm Intelligence in Python (Genetic Algorithm, Particle Swarm Optimization, Simulated Annealing, Ant Colony Algorithm, Immune Algorithm,A

郭飞 3.7k Jan 3, 2023
Based on Yolo's low-power, ultra-lightweight universal target detection algorithm, the parameter is only 250k, and the speed of the smart phone mobile terminal can reach ~300fps+

Based on Yolo's low-power, ultra-lightweight universal target detection algorithm, the parameter is only 250k, and the speed of the smart phone mobile terminal can reach ~300fps+

null 567 Dec 26, 2022
Vehicle Detection Using Deep Learning and YOLO Algorithm

VehicleDetection Vehicle Detection Using Deep Learning and YOLO Algorithm Dataset take or find vehicle images for create a special dataset for fine-tu

Maryam Boneh 96 Jan 5, 2023
Real Time Object Detection and Classification using Yolo Algorithm.

Real time Object detection & Classification using YOLO algorithm. Real Time Object Detection and Classification using Yolo Algorithm. What is Object D

Ketan Chawla 1 Apr 17, 2022