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.

This project requires a Python backend to run AI models.
start_share.py running).demo.webp above.backend/ folder for the YOLOv8 + FastAPI logic.frontend/index.html for the React-based dashboard.git clone https://github.com/your-username/LaneGuard.git
cd LaneGuard
pip install -r backend/requirements.txt
(Note: If strict versions fail, just install: ultralytics opencv-python fastapi uvicorn paho-mqtt)
yolov8n.pt. If it’s missing, run:
python download_model.py
Start the Application:
Double-click run_app.bat (Windows)
OR run via terminal:
python -m backend.main
Open Dashboard: Go to 👉 http://localhost:8000
If you need to show the app to someone else (hackathon judges) without them installing anything:
run_app.bat to start the server.python start_share.py in a separate terminal.highway_sample.mp4 from the root folder.highway_sample.mp4 in the root folder. (The app currently includes a sample video).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]
Alerts are published to highway/enforcement/alerts on broker.hivemq.com (Public Broker).
MIT License. Built for Hackathon purposes.