DEMO.1.mp4
RoadVision AI is a comprehensive, Real-Time Traffic Intelligence System designed to monitor roads, detect accidents, recognize license plates, and generate detailed traffic reports. Built with state-of-the-art Computer Vision models, this system provides a robust solution for traffic management and incident response by utilizing a highly optimized Master-Slave threading architecture.
- Real-Time Object Tracking: Tracks vehicles using advanced YOLOv8 models.
- Accident Detection: Accurately detects accidents in real-time utilizing VideoMAE Transformer models.
- Automatic License Plate Recognition (ALPR): Extracts license plates via EasyOCR for incident reporting.
- Speed & Anomaly Detection: Calibrates speed and detects anomalies using Bird's-Eye View (BEV) mapping.
- PyQt6 Dashboard: A sleek, non-blocking user interface for real-time monitoring and alert visualization.
- Automated Reporting: Generates comprehensive PDF, JSON, and CSV reports for traffic sessions and incidents.
- AI Verification: Integrates with Gemini AI for intelligent incident verification.
- Programming Language: Python 3.9+
- Computer Vision & Deep Learning:
- OpenCV
- PyTorch & Torchvision
- Ultralytics (YOLOv8)
- Transformers & TIMM (VideoMAE)
- Optical Character Recognition: EasyOCR
- Generative AI: Google Generative AI (Gemini)
- User Interface: PyQt6, PyQtGraph
- Data & Reporting: Pandas, NumPy, ReportLab, Matplotlib
-
Clone the Repository (If you haven't already)
git clone https://github.com/YusufAly1/RoadVision-AI.git cd RoadVision-AI -
Create a Virtual Environment
python3 -m venv venv source venv/bin/activate # For Windows: venv\Scripts\activate
-
Install Dependencies
pip install -r requirements.txt
-
Download AI Models The application requires several pre-trained models. Run the following script to prepare them:
python download_models.py
Note: For the custom VideoMAE and YOLO Plate Detection models, either add their URLs to your
.envfile before running the script, or manually place the.pthand.ptfiles as instructed by the script. -
Configuration Copy the
.env.exampleto.envand fill in your Gemini API key for incident verification:cp .env.example .env
-
Provide a Test Video Place your test
.mp4video inside thevideos/folder.
Ensure your virtual environment is activated, then run the main entry point to launch the application dashboard:
python main.pyOnce the UI launches, you can connect your video source (or select the test video), and the system will begin monitoring the feed for vehicles, speeds, and accidents.
- Multi-Camera Support: Expand the system to handle multiple concurrent video streams for comprehensive intersection coverage.
- Cloud Integration: Implement cloud-based processing and storage for historical traffic data analysis and remote dashboard access.
- Enhanced Vehicle Re-Identification: Improve tracking consistency across different camera angles and environmental conditions.
- Edge Deployment: Optimize the models further (e.g., via TensorRT or ONNX) for deployment on edge devices like NVIDIA Jetson.
- Night Vision Mode: Train models to better perform under low-light and adverse weather conditions.
This project is licensed under the MIT License. See the LICENSE file for details.