This project is focused on addressing the traffic management problem in Bengaluru through vehicle detection, tracking, and prediction methodologies. It was developed for a hackathon co-organized by the Bengaluru Traffic Police, the Centre for Data for Public Good, and the Indian Institute of Science (IISc).
The project aims to:
- Detect and classify vehicles moving in multiple directions on different road segments.
- Track vehicle movements between designated points on the road.
- Count vehicles and predict traffic flow using advanced tracking and forecasting techniques.
This repository includes the code and dataset preprocessing steps used to build and evaluate the detection and prediction models, along with analysis for optimizing traffic flow and congestion management in Bengaluru.
- Vehicle Detection and Classification: Utilizes object detection models to classify vehicles (e.g., cars, bikes, buses) into types.
- Tracking and Direction Analysis: Tracks vehicle movements across six directions, classifying direction and counting vehicle types per segment.
- Forecasting Traffic Flow: Employs the ARIMA model to predict vehicle counts at 1.5-minute intervals, aiding in traffic control and congestion prediction.
- Enhanced Tracking Accuracy: Leverages Kalman filters for improved vehicle tracking precision across frames.
-
Clone the repository:
git clone https://github.com/nabayansaha/Vehicle-Detection-Tracking-and-Future-Predictions-The-Bengaluru-Mobility-Challenge.git
-
Navigate to the project directory:
cd Vehicle-Detection-Tracking-and-Future-Predictions-The-Bengaluru-Mobility-Challenge
-
Set up the environment:
conda activate test_env_gpu
- Prepare your dataset by organizing vehicle images according to the specified directory structure.
- Run the detection and tracking models to classify vehicles and analyze their directions.
- Output the vehicle counts and directions to a CSV file.
- Use the ARIMA model to predict vehicle flow based on tracked data.
For further details, refer to the scripts within each directory.
Vehicle-Detection-Tracking-and-Future-Predictions-The-Bengaluru-Mobility-Challenge
├── data/ # Dataset directory
├── models/ # Pre-trained and custom models
├── notebooks/ # Jupyter notebooks for experimentation
├── src/ # Core code for detection, tracking, and prediction
└── README.md # Project overview and instructions
- Vehicle Classification: Detect and classify vehicles using object detection models.
- Tracking and Counting: Track vehicle movement and count each type of vehicle for designated road segments.
- Future Prediction: Apply ARIMA to forecast traffic volumes at intervals to support traffic management.
- Expand the vehicle classification to identify more vehicle types.
- Improve prediction accuracy by experimenting with other time-series models.
- Extend the project to provide real-time traffic analytics.
Contributions are welcome. Please fork the repository and submit a pull request.
This project is licensed under the Apache-2.0 license