Skip to content

Repository files navigation

RoadVision AI - Traffic Intelligence System

🎥 Demo

DEMO.1.mp4

Python Version License Build

📖 Project Overview

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.

✨ Features

  • 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.

🛠 Technologies Used

  • 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

⚙️ Installation Steps

  1. Clone the Repository (If you haven't already)

    git clone https://github.com/YusufAly1/RoadVision-AI.git
    cd RoadVision-AI
  2. Create a Virtual Environment

    python3 -m venv venv
    source venv/bin/activate
    # For Windows: venv\Scripts\activate
  3. Install Dependencies

    pip install -r requirements.txt
  4. 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 .env file before running the script, or manually place the .pth and .pt files as instructed by the script.

  5. Configuration Copy the .env.example to .env and fill in your Gemini API key for incident verification:

    cp .env.example .env
  6. Provide a Test Video Place your test .mp4 video inside the videos/ folder.

🚀 Usage

Ensure your virtual environment is activated, then run the main entry point to launch the application dashboard:

python main.py

Once 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.

🔮 Future Improvements

  • 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.

📄 License

This project is licensed under the MIT License. See the LICENSE file for details.

About

RoadVision AI is a Real-Time Traffic Intelligence System designed to monitor roads, detect accidents, recognize license plates, and generate detailed traffic reports.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages