LaneGuardVision.

🛣️👁️LaneGuard Vision

AI-Powered Highway Lane Enforcement System MVP

A real-time computer vision system built for Tech Sprint Hackathon to detect heavy vehicles illegally occupying fast lanes on National Highways.


🚨 LIVE DEMO (ACTION CAPTURE)

LaneGuard Vision Demo

This project requires a Python backend to run AI models.


🚀 Features

🛠️ Tech Stack

📦 Installation

  1. Clone the repository:
    git clone https://github.com/your-username/LaneGuard.git
    cd LaneGuard
    
  2. Install Dependencies:
    pip install -r backend/requirements.txt
    

    (Note: If strict versions fail, just install: ultralytics opencv-python fastapi uvicorn paho-mqtt)

  3. Setup Models:
    • The app uses yolov8n.pt. If it’s missing, run:
      python download_model.py
      

🚥 How to Run

  1. Start the Application: Double-click run_app.bat (Windows)

    OR run via terminal:

    python -m backend.main
    
  2. Open Dashboard: Go to 👉 http://localhost:8000

🌐 Sharing with Evaluators (ngrok)

If you need to show the app to someone else (hackathon judges) without them installing anything:

  1. Run run_app.bat to start the server.
  2. Run python start_share.py in a separate terminal.
  3. Copy the Public Link generated and paste it into the “Live Demo” section of this README.

⚙️ Configuration

📹 Video Source

🚛 Detection Logic

Debug Mode (Current): The backend/detector.py is currently configured to detect Everything (Cars, Persons, Trucks) for demo purposes.

Strict Mode (Heavy Vehicles Only): Edit backend/detector.py:

# Change this line:
self.HV_CLASSES = [0, 2, 5, 7] 
# To this (Bus & Truck only):
self.HV_CLASSES = [5, 7]

📡 MQTT Alerts

Alerts are published to highway/enforcement/alerts on broker.hivemq.com (Public Broker).

📄 License

MIT License. Built for Hackathon purposes.