Vehicle_Detection_and_Counting_System icon indicating copy to clipboard operation
Vehicle_Detection_and_Counting_System copied to clipboard

Building a small demo system to detect and count vehicle using Streamlit framework

Vehicle Detection and Counting System on Streamlit

Demo image

Introduction

This project is used to count and detect vehicle on the highway. It can detect 4 types of vehicles: car, motorcycle, bus, truck. I run this project on Python 3.9.7

  • YOLOv5 to detect objects on each of the video frames.

  • Deep SORT to track those objects over different frames and help counting.

  • Streamlit to build a simple web.

Installation

  • Install essential libraries and packages:
pip install -r requirements.txt
  • Run demo:
streamlit run demo.py --server.maxUploadSize=500

NOTE: If the web keeps showing "Please wait...", try to install streamlit version 1.11.0

pip install streamlit==1.11.0

If the web shows error "no module easydict"

pip install easydict

DEMO

Steps:

  1. Click Browse files to input video

  2. Setting Custom classes, Confidence and Line position

Settings

  • Custom classes: choose classes you want to detect

  • Confidence: the probability that one object belongs to one class

  • Line position: the position of green line, any vehicle have coordinate below the line will be counted

  1. Click START

Result

demo