Traffic-analysis

AI based Decision support system for Traffic Control

AI based Decision support system for Traffic Control is an helpful tool for traffic cops to analyze the traffic using ML and IoT.

Table of contents

01 Motivation

Knowing that traffic officers won’t have the view of the whole traffic, this project has a web-based dashboard to assist traffic officers in making decisions depending on the volume of traffic only by visualizing the count of vehicles from each lane. This would serve as a hybrid way of traffic support to the cop instead of fully automating traffic control.In this project we have also implemented the algorithm using Intel oneAPI Toolkit.

02 Problem Statement

Image Recognition: Develop a computer vision project using Scikit-Learn’s image processing capabilities. You could use a dataset of images to train a model to recognize specific objects or classify images into categories.

03 Setup

We have used IntelOneApi Toolkit to make the system run in any environment and it extends the code portability across all processor architectures. Hence, in our model, the usage of oneAPI served to be helpful in terms of optimization.

04 Overview of the project

Explanation & implementation of the project : Link

Source code: Link

05 Implementation - Algorithm

Deep Learning Algorithm - Yolov5 + Deepsort with PyTorch 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. For backend, Flask and Jinga was used For database - Firebase (No-SQL) in cloud and Sqlite in edge was used.

06 Deployment of OneAPI

OneAPI is used enable the use of one platform for a range of different hardware, hence it eliminated the need for different languages, tools, and libraries when to code for CPUs and GPUs. Openvino was used in this project which helped in optimization of the computer vision packages that were used including OpenCV and other DL packages required for it.

Implementing OpenVINO link

Steps

Step 1: Create virtual environment

python -m venv openvino_env

Step 2: Activate virtual environment

openvino_env\Scripts\activate

Step 3: Upgrade pip to latest version

python -m pip install --upgrade pip

Step 4: Download and install the package

pip install openvino-dev==2022.3.0

How to run,

• Create a virtual environment and activate it • Download the packages using the command,

pip install -r requirements.txt

• In a terminal, run mainProgram.py

python mainProgram.py

OPENVINO_ENV

• In another terminal, run the frontend using the command,

python -m flask run

OPENVINO 2

• CTRL + click on the link to open the web dashboard.

07 Output - Count taken

Real time dataset

**Prototype live detection and count** # 08 Web dashboard Final view of the Traffic shown in the web dashboard. ![wb1](https://user-images.githubusercontent.com/118420309/226320383-9fbf0c35-a422-4ac8-8ea6-2cd150df685f.png) ![wb2](https://user-images.githubusercontent.com/118420309/226320397-def3e802-d4d3-43e6-b10a-4e78d0845f7b.png)