All Projects → ahmetozlu → Vehicle_counting_tensorflow

ahmetozlu / Vehicle_counting_tensorflow

Licence: mit
🚘 "MORE THAN VEHICLE COUNTING!" This project provides prediction for speed, color and size of the vehicles with TensorFlow Object Counting API.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Vehicle counting tensorflow

Tensorflow object counting api
🚀 The TensorFlow Object Counting API is an open source framework built on top of TensorFlow and Keras that makes it easy to develop object counting systems!
Stars: ✭ 956 (+64.26%)
Mutual labels:  object-detection, data-science, deep-neural-networks, opencv, image-processing
Computer Vision Guide
📖 This guide is to help you understand the basics of the computerized image and develop computer vision projects with OpenCV. Includes Python, Java, JavaScript, C# and C++ examples.
Stars: ✭ 244 (-58.08%)
Mutual labels:  object-detection, deep-neural-networks, opencv, image-processing
Ssd Pytorch
SSD: Single Shot MultiBox Detector pytorch implementation focusing on simplicity
Stars: ✭ 107 (-81.62%)
Mutual labels:  object-detection, deep-neural-networks, detection
Sod
An Embedded Computer Vision & Machine Learning Library (CPU Optimized & IoT Capable)
Stars: ✭ 1,460 (+150.86%)
Mutual labels:  object-detection, image-processing, detection
Bmw Yolov4 Inference Api Cpu
This is a repository for an nocode object detection inference API using the Yolov4 and Yolov3 Opencv.
Stars: ✭ 180 (-69.07%)
Mutual labels:  object-detection, deep-neural-networks, opencv
Computervision Recipes
Best Practices, code samples, and documentation for Computer Vision.
Stars: ✭ 8,214 (+1311.34%)
Mutual labels:  object-detection, data-science, image-processing
Kaggle Rsna
Deep Learning for Automatic Pneumonia Detection, RSNA challenge
Stars: ✭ 74 (-87.29%)
Mutual labels:  object-detection, image-processing, detection
Caer
High-performance Vision library in Python. Scale your research, not boilerplate.
Stars: ✭ 452 (-22.34%)
Mutual labels:  data-science, opencv, image-processing
Imageai
A python library built to empower developers to build applications and systems with self-contained Computer Vision capabilities
Stars: ✭ 6,734 (+1057.04%)
Mutual labels:  object-detection, prediction, detection
Caffe2 Ios
Caffe2 on iOS Real-time Demo. Test with Your Own Model and Photos.
Stars: ✭ 221 (-62.03%)
Mutual labels:  object-detection, deep-neural-networks, opencv
Pine
🌲 Aimbot powered by real-time object detection with neural networks, GPU accelerated with Nvidia. Optimized for use with CS:GO.
Stars: ✭ 202 (-65.29%)
Mutual labels:  object-detection, opencv, detection
Real time object detection and tracking
YOLOv2 and MobileNet_SSD detection algorithms used along with KCF object tracker
Stars: ✭ 241 (-58.59%)
Mutual labels:  object-detection, opencv, detection
Albumentations
Fast image augmentation library and an easy-to-use wrapper around other libraries. Documentation: https://albumentations.ai/docs/ Paper about the library: https://www.mdpi.com/2078-2489/11/2/125
Stars: ✭ 9,353 (+1507.04%)
Mutual labels:  object-detection, image-processing, detection
Cnn Paper2
🎨 🎨 深度学习 卷积神经网络教程 :图像识别,目标检测,语义分割,实例分割,人脸识别,神经风格转换,GAN等🎨🎨 https://dataxujing.github.io/CNN-paper2/
Stars: ✭ 77 (-86.77%)
Mutual labels:  object-detection, deep-neural-networks, detection
Medicaldetectiontoolkit
The Medical Detection Toolkit contains 2D + 3D implementations of prevalent object detectors such as Mask R-CNN, Retina Net, Retina U-Net, as well as a training and inference framework focused on dealing with medical images.
Stars: ✭ 917 (+57.56%)
Mutual labels:  object-detection, deep-neural-networks, detection
Color Tracker
Color tracking with OpenCV
Stars: ✭ 128 (-78.01%)
Mutual labels:  object-detection, opencv, image-processing
Android Yolo
Real-time object detection on Android using the YOLO network with TensorFlow
Stars: ✭ 604 (+3.78%)
Mutual labels:  object-detection, prediction, detection
Yolo Tf2
yolo(all versions) implementation in keras and tensorflow 2.4
Stars: ✭ 695 (+19.42%)
Mutual labels:  object-detection, deep-neural-networks, image-processing
Marvel
Marvel - Face Recognition With Android & OpenCV
Stars: ✭ 199 (-65.81%)
Mutual labels:  object-detection, opencv, image-processing
Tracking With Darkflow
Real-time people Multitracker using YOLO v2 and deep_sort with tensorflow
Stars: ✭ 515 (-11.51%)
Mutual labels:  object-detection, deep-neural-networks, image-processing

VEHICLE DETECTION, TRACKING AND COUNTING

This sample project focuses on "Vechicle Detection, Tracking and Counting" using TensorFlow Object Counting API. Please contact if you need professional vehicle detection & tracking & counting project with the super high accuracy!


The TensorFlow Object Counting API is used as a base for object counting on this project, more info can be found on this repo.



The developing is on progress! This sample project will be updated soon, the more talented traffic analyzer app will be available in this repo!


General Capabilities of This Sample Project

This sample project has more than just counting vehicles, here are the additional capabilities of it:

  • Detection and classification of the vehicles (car, truck, bicycle, motorcycle, bus)
  • Recognition of approximate vehicle color
  • Detection of vehicle direction of travel
  • Prediction the speed of the vehicle
  • Prediction of approximate vehicle size
  • The images of detected vehicles are cropped from video frame and they are saved as new images under "detected_vehicles" folder path
  • The program gives a .csv file as an output (traffic_measurement.csv) which includes "Vehicle Type/Size", " Vehicle Color", " Vehicle Movement Direction", " Vehicle Speed (km/h)" rows, after the end of the process for the source video file.

ToDos:

  • More powerful detection models will be shared.
  • Sample codes will be developed to process different types of input videos (for different types of road traffics such as two way lane road).
  • Code cleanup will be performed.
  • UI will be developed.

The input video can be accessible by this link.

Theory

System Architecture

  • Vehicle detection and classification have been developed using TensorFlow Object Detection API, see for more info.
  • Vehicle speed prediction has been developed using OpenCV via image pixel manipulation and calculation, see for more info.
  • Vehicle color prediction has been developed using OpenCV via K-Nearest Neighbors Machine Learning Classification Algorithm is Trained Color Histogram Features, see for more info.

TensorFlow™ is an open source software library for numerical computation using data flow graphs. Nodes in the graph represent mathematical operations, while the graph edges represent the multidimensional data arrays (tensors) communicated between them.

OpenCV (Open Source Computer Vision Library) is an open source computer vision and machine learning software library. OpenCV was built to provide a common infrastructure for computer vision applications and to accelerate the use of machine perception in the commercial products.

Tracker

Source video is read frame by frame with OpenCV. Each frames is processed by "SSD with Mobilenet" model is developed on TensorFlow. This is a loop that continue working till reaching end of the video. The main pipeline of the tracker is given at the above Figure.

Model

By default I use an "SSD with Mobilenet" model in this project. You can find more information about SSD in here. See the detection model zoo for a list of other models that can be run out-of-the-box with varying speeds and accuracies.

The minimum vehicle detection threshold can be set in this line in terms of percentage. The default minimum vehicle detecion threshold is 0.5!

Project Demo

Demo video of the project is available on My YouTube Channel.

Installation

Docker setup with Nvidia GPU: Run the demo in the GPU without installing anything, just nvidia-docker. The command to set up this docker:

docker-compose up

Alternative for nvidia-docker, you can follow the installation steps are given below!

1.) Python and pip

Python is automatically installed on Ubuntu. Take a moment to confirm (by issuing a python -V command) that one of the following Python versions is already installed on your system:

  • Python 3.3+

The pip or pip3 package manager is usually installed on Ubuntu. Take a moment to confirm (by issuing a pip -V or pip3 -V command) that pip or pip3 is installed. We strongly recommend version 8.1 or higher of pip or pip3. If Version 8.1 or later is not installed, issue the following command, which will either install or upgrade to the latest pip version:

$ sudo apt-get install python3-pip python3-dev # for Python 3.n

2.) OpenCV

See required commands to install OpenCV on Ubuntu in here.

3.) TensorFlow

Install TensorFlow by invoking one of the following commands:

$ pip3 install tensorflow     # Python 3.n; CPU support (no GPU support)
$ pip3 install tensorflow-gpu # Python 3.n; GPU support

Current program is compatible with TensorFlow 1.5.0 version. Please uncomment these lines to run the program with TensorFlow 2.x: #1, #2, #3, #4.

4.) TensorFlow Object Detection API

See required commands to install TensorFlow Object Detection API on Ubuntu in here.

If you are still getting problem about installation after completed the installation of the packet that are given above, please check that link out to get detailed info about installation.


How to run the program?

After completing these 4 installation steps that are given at above, you can test the project by one of these commands. Program takes an input argument 'imshow' or 'imwrite':

  python3 vehicle_detection_main.py imshow
  python3 vehicle_detection_main.py imwrite
  • imshow : shows the processed frames as an video on screen.
  • imwrite : saves the processed frames as an output video in the project root folder.

Citation

If you use this code for your publications, please cite it as:

@ONLINE{vdtct,
    author = "Ahmet Özlü",
    title  = "Vehicle Detection, Tracking and Counting by TensorFlow",
    year   = "2018",
    url    = "https://github.com/ahmetozlu/vehicle_counting_tensorflow"
}

Author

Ahmet Özlü

License

This system is available under the MIT license. See the LICENSE file for more info.

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].