All Projects → guptavasu1213 → Yolo Vehicle Counter

guptavasu1213 / Yolo Vehicle Counter

This project aims to count every vehicle (motorcycle, bus, car, cycle, truck, train) detected in the input video using YOLOv3 object-detection algorithm.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Yolo Vehicle Counter

Yolov3
YOLOv3 in PyTorch > ONNX > CoreML > TFLite
Stars: ✭ 8,159 (+29039.29%)
Mutual labels:  object-detection, yolo, yolov3
Pytorch Yolo V3
A PyTorch implementation of the YOLO v3 object detection algorithm
Stars: ✭ 3,148 (+11142.86%)
Mutual labels:  object-detection, yolo, yolov3
Yolov3 Tf2
YoloV3 Implemented in Tensorflow 2.0
Stars: ✭ 2,327 (+8210.71%)
Mutual labels:  object-detection, yolo, yolov3
Yolov5 ncnn
🍅 Deploy NCNN on mobile phones. Support Android and iOS. 移动端NCNN部署,支持Android与iOS。
Stars: ✭ 535 (+1810.71%)
Mutual labels:  object-detection, yolo, yolov3
Yolo Tf2
yolo(all versions) implementation in keras and tensorflow 2.4
Stars: ✭ 695 (+2382.14%)
Mutual labels:  object-detection, yolo, yolov3
Keras Yolov3 Mobilenet
I transfer the backend of yolov3 into Mobilenetv1,VGG16,ResNet101 and ResNeXt101
Stars: ✭ 552 (+1871.43%)
Mutual labels:  object-detection, yolo, yolov3
Yolodet Pytorch
reproduce the YOLO series of papers in pytorch, including YOLOv4, PP-YOLO, YOLOv5,YOLOv3, etc.
Stars: ✭ 206 (+635.71%)
Mutual labels:  object-detection, yolo, yolov3
Bmw Labeltool Lite
This repository provides you with a easy to use labeling tool for State-of-the-art Deep Learning training purposes.
Stars: ✭ 145 (+417.86%)
Mutual labels:  object-detection, yolo, yolov3
Tensorflow Yolo V3
Implementation of YOLO v3 object detector in Tensorflow (TF-Slim)
Stars: ✭ 862 (+2978.57%)
Mutual labels:  object-detection, yolo, yolov3
Deep Sort Yolov4
People detection and optional tracking with Tensorflow backend.
Stars: ✭ 306 (+992.86%)
Mutual labels:  object-detection, yolo, yolov3
Bmw Yolov4 Training Automation
This repository allows you to get started with training a state-of-the-art Deep Learning model with little to no configuration needed! You provide your labeled dataset or label your dataset using our BMW-LabelTool-Lite and you can start the training right away and monitor it in many different ways like TensorBoard or a custom REST API and GUI. NoCode training with YOLOv4 and YOLOV3 has never been so easy.
Stars: ✭ 533 (+1803.57%)
Mutual labels:  object-detection, yolo, yolov3
Yolo3 4 Py
A Python wrapper on Darknet. Compatible with YOLO V3.
Stars: ✭ 504 (+1700%)
Mutual labels:  object-detection, yolo, yolov3
Object Detection Api
Yolov3 Object Detection implemented as APIs, using TensorFlow and Flask
Stars: ✭ 177 (+532.14%)
Mutual labels:  object-detection, yolo, yolov3
Yolov3 pytorch
Full implementation of YOLOv3 in PyTorch
Stars: ✭ 570 (+1935.71%)
Mutual labels:  object-detection, yolo, yolov3
Yolo v3 tutorial from scratch
Accompanying code for Paperspace tutorial series "How to Implement YOLO v3 Object Detector from Scratch"
Stars: ✭ 2,192 (+7728.57%)
Mutual labels:  object-detection, yolo, yolov3
Pine
🌲 Aimbot powered by real-time object detection with neural networks, GPU accelerated with Nvidia. Optimized for use with CS:GO.
Stars: ✭ 202 (+621.43%)
Mutual labels:  object-detection, yolo, yolov3
Yolo V3 Iou
YOLO3 动漫人脸检测 (Based on keras and tensorflow) 2019-1-19
Stars: ✭ 116 (+314.29%)
Mutual labels:  object-detection, yolo, yolov3
Yolo label
GUI for marking bounded boxes of objects in images for training neural network Yolo v3 and v2 https://github.com/AlexeyAB/darknet, https://github.com/pjreddie/darknet
Stars: ✭ 128 (+357.14%)
Mutual labels:  object-detection, yolo, yolov3
Alturos.yolo
C# Yolo Darknet Wrapper (real-time object detection)
Stars: ✭ 308 (+1000%)
Mutual labels:  object-detection, yolo, yolov3
Trainyourownyolo
Train a state-of-the-art yolov3 object detector from scratch!
Stars: ✭ 399 (+1325%)
Mutual labels:  object-detection, yolo, yolov3

Yolo Vehicle Counter

Overview

You Only Look Once (YOLO) is a CNN architecture for performing real-time object detection. The algorithm applies a single neural network to the full image, and then divides the image into regions and predicts bounding boxes and probabilities for each region. For more detailed working of YOLO algorithm, please refer to the YOLO paper.

This project aims to count every vehicle (motorcycle, bus, car, cycle, truck, train) detected in the input video using YOLOv3 object-detection algorithm.

Working

As shown in the image above, when the vehicles in the frame are detected, they are counted. After getting detected once, the vehicles get tracked and do not get re-counted by the algorithm.

You may also notice that the vehicles will initially be detected and the counter increments, but for a few frames, the vehicle is not detected, and then it gets detected again. As the vehicles are tracked, the vehicles are not re-counted if they are counted once.

Prerequisites

  • Linux distro or MacOS (Tested on Ubuntu 18.04)
  • A street video file to run the vehicle counting
  • The pre-trained yolov3 weight file should be downloaded by following these steps:
cd yolo-coco
wget https://pjreddie.com/media/files/yolov3.weights

Dependencies for using CPU for computations

  • Python3 (Tested on Python 3.6.9)
sudo apt-get upgrade python3
  • Pip3
sudo apt-get install python3-pip
  • OpenCV 3.4 or above(Tested on OpenCV 3.4.2.17)
pip3 install opencv-python==3.4.2.17
  • Imutils
pip3 install imutils
  • Scipy
pip3 install scipy

Dependencies for using GPU for computations

Usage

  • --input or -i argument requires the path to the input video
  • --output or -o argument requires the path to the output video
  • --yolo or -y argument requires the path to the folder where the configuration file, weights and the coco.names file is stored
  • --confidence or -c is an optional argument which requires a float number between 0 to 1 denoting the minimum confidence of detections. By default, the confidence is 0.5 (50%).
  • --threshold or -t is an optional argument which requires a float number between 0 to 1 denoting the threshold when applying non-maxima suppression. By default, the threshold is 0.3 (30%).
  • --use-gpu or -u is an optional argument which requires 0 or 1 denoting the use of GPU. By default, the CPU is used for computations
python3 yolo_video.py --input <input video path> --output <output video path> --yolo yolo-coco [--confidence <float number between 0 and 1>] [--threshold <float number between 0 and 1>] [--use-gpu 1]

Examples:

  • Running with defaults
python3 yolo_video.py --input inputVideos/highway.mp4 --output outputVideos/highwayOut.avi --yolo yolo-coco 
  • Specifying confidence
python3 yolo_video.py --input inputVideos/highway.mp4 --output outputVideos/highwayOut.avi --yolo yolo-coco --confidence 0.3
  • Using GPU
python3 yolo_video.py --input inputVideos/highway.mp4 --output outputVideos/highwayOut.avi --yolo yolo-coco --use-gpu 1

Implementation details

  • The detections are performed on each frame by using YOLOv3 object detection algorithm and displayed on the screen with bounding boxes.
  • The detections are filtered to keep all vehicles like motorcycle, bus, car, cycle, truck, train. The reason why trains are also counted is because sometimes, the longer vehicles like a bus, is detected as a train; therefore, the trains are also taken into account.
  • The center of each box is taken as a reference point (denoted by a green dot when performing the detections) when track the vehicles.
  • Also, in order to track the vehicles, the shortest distance to the center point is calculated for each vehicle in the last 10 frames.
  • If shortest distance < max(width, height) / 2, then the vehicles is not counted in the current frame. Else, the vehicle is counted again. Usually, the direction in which the vehicle moves is bigger than the other one.
  • For example, if a vehicle moves from North to South or South to North, the height of the vehicle is most likely going to be greater than or equal to the width. Therefore, in this case, height/2 is compared to the shortest distance in the last 10 frames.
  • As YOLO misses a few detections for a few consecutive frames, this issue can be resolved by saving the detections for the last 10 frames and comparing them to the current frame detections when required. The size of the vehicle does not vary too much in 10 frames and has been tested in multiple scenarios; therefore, 10 frames was chosen as an optimal value.

Reference

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].