This project utilizes drone technology, YOLOv8 object detection, and machine learning to predict traffic flow and manage traffic signals dynamically. By integrating aerial surveillance, ground-level data, and regression models, it offers a scalable solution for urban traffic management.
Urban areas face increasing challenges with traffic congestion. This project addresses these issues through:
- Drone Technology: High-resolution aerial footage for extensive traffic monitoring.
- YOLOv8: Cutting-edge object detection for real-time vehicle tracking.
- Regression Models: Optimized traffic signal timings based on real-time data.
- Raspberry Pi: Edge computing for adaptive traffic control.
- Real-Time Traffic Monitoring: High-speed vehicle detection using YOLOv8.
- Dynamic Signal Control: Adapts signal intervals based on traffic density.
- Scalable Design: Supports multi-intersection deployment.
- Cost-Efficient Hardware: Operates on resource-constrained devices like Raspberry Pi.
- Drone: High-resolution camera and GPS module.
- Raspberry Pi 5: Central processing unit for real-time analysis.
- Pixhawk Flight Controller: Ensures smooth drone operation.
- Wireless Communication Modules: For seamless connectivity.
Preview: Displays the web application interface used for monitoring and control.
Preview: Example of a red light scenario captured by the system.
Preview: Demonstrates the system’s response during low traffic conditions.
Preview: Highlights the system’s action during high traffic scenarios.
-
Clone the repository:
git clone https://github.com/your-username/Real-Time-Traffic-Flow-Prediction.git
-
Install the required Python packages:
-
Dataset Preparation:
- Organize the dataset in YOLOv8 format (images and corresponding label files).
- Use pre-existing datasets like COCO or create a custom labeled dataset tailored for traffic.
-
Train the Model: Use the following command to fine-tune YOLOv8:
python train.py --data path/to/dataset.yaml --weights yolov8.pt
-
Evaluate the Model: After training, evaluate the model performance on the test set:
python val.py --data path/to/dataset.yaml --weights best.pt
-
Vehicle Detection: Start the YOLOv8 model to process drone footage in real-time:
python detect.py --source path/to/video.mp4 --weights best.pt
-
Dynamic Signal Control: Run the regression model to predict optimal signal durations and control traffic signals dynamically:
python signal_control.py
-
Deploy on Edge Device: Set up the Raspberry Pi to process traffic data locally and control signals.
Contributions to the project are encouraged! Whether you're interested in adding new features, fixing bugs, or improving documentation, please submit pull requests. Follow the contribution guidelines outlined in CONTRIBUTING.md
.