Skip to content

tashfeen786/HelmetEye

Repository files navigation

πŸͺ– HelmetEye β€” AI-Powered Traffic Surveillance System

Python FastAPI Next.js YOLOv12 TypeScript License

πŸŽ“ Final Year Project (FYP) β€” Bachelor of Information Technology
University of Kotli, AJK (2021–2025)

An intelligent real-time traffic surveillance system that automatically detects helmet violations and vehicle number plates from live video feeds β€” built to automate traffic monitoring and support law enforcement agencies.


🚨 Problem Statement

Manual traffic monitoring is:

  • ❌ Slow, error-prone, and resource-heavy
  • ❌ Unable to scale across multiple camera feeds
  • ❌ Inconsistent in catching violations in real-time

HelmetEye solves this by using computer vision and deep learning to automatically detect violations, extract number plate data, and log everything to a database β€” with zero human intervention.


✨ Key Features

  • πŸͺ– Real-time helmet detection using YOLOv12
  • πŸ”’ Automatic number plate recognition via OCR
  • πŸ“Ή Live video feed processing frame by frame
  • πŸ—„οΈ Violation logging with timestamp to database
  • ⚑ FastAPI backend for fast, scalable API handling
  • πŸ’» Next.js dashboard for live monitoring and violation history
  • πŸ“Š Docs folder with project documentation

πŸ› οΈ Tech Stack

Layer Technology
🧠 Detection Model YOLOv12
πŸ”€ OCR Engine EasyOCR / Tesseract
βš™οΈ Backend Python, FastAPI
🎨 Frontend Next.js, TypeScript, Tailwind CSS
πŸ—„οΈ Database PostgreSQL / MySQL
πŸ‘οΈ Computer Vision OpenCV
πŸš€ Hosting Firebase App Hosting

πŸ—οΈ Project Structure

HelmetEye/
β”‚
β”œβ”€β”€ backend/                  # Python FastAPI backend
β”‚   β”œβ”€β”€ models/               # YOLOv12 model files
β”‚   β”œβ”€β”€ routes/               # API endpoints
β”‚   β”œβ”€β”€ ocr/                  # Number plate OCR logic
β”‚   └── main.py               # FastAPI entry point
β”‚
β”œβ”€β”€ src/                      # Next.js frontend
β”‚   └── app/
β”‚       └── page.tsx          # Main dashboard page
β”‚
β”œβ”€β”€ docs/                     # Project documentation
β”œβ”€β”€ next.config.ts            # Next.js configuration
β”œβ”€β”€ tailwind.config.ts        # Tailwind CSS config
└── apphosting.yaml           # Firebase hosting config

πŸ”„ How It Works

πŸ“Ή Live Video Feed ↓ 🧠 YOLOv12 Detection (helmet + number plate) ↓ πŸ”€ OCR Engine (extracts plate text) ↓ βš™οΈ FastAPI Backend (processes & validates) ↓ πŸ—„οΈ Database (logs violation + timestamp) ↓ πŸ’» Next.js Dashboard (displays live results)


πŸš€ Getting Started

Prerequisites

  • Python 3.9+
  • Node.js 18+
  • PostgreSQL

Backend Setup

# Clone the repo
git clone https://github.com/tashfeen786/HelmetEye.git
cd HelmetEye/backend

# Install Python dependencies
pip install -r requirements.txt

# Start FastAPI server
uvicorn main:app --reload --port 8000

Frontend Setup

# Go to root directory
cd ..

# Install Node dependencies
npm install

# Start Next.js dev server
npm run dev

Environment Variables

Create a .env file in the backend folder:

DATABASE_URL=postgresql://user:password@localhost:5432/helmeteye
MODEL_PATH=./models/yolov12_helmet.pt

πŸ“Έ Screenshots

πŸ”œ Coming soon β€” live demo screenshots


πŸ“Š Model Performance

Metric Value
Detection Model YOLOv12
Task Helmet + Number Plate Detection
Input Live video / image frames
OCR Real-time text extraction

🎯 Use Cases

  • πŸ™οΈ Smart City Infrastructure β€” automated violation detection
  • πŸš” Traffic Law Enforcement β€” instant number plate logging
  • πŸ“Š Road Safety Analytics β€” violation trend reporting
  • 🏍️ Highway Monitoring β€” large-scale deployment ready

πŸ‘¨β€πŸ’» Author

Tashfeen Aziz β€” AI/ML Engineer & Python Developer

LinkedIn GitHub Email


πŸ“„ License

This project is licensed under the MIT License.


⭐ If you found this project helpful, please give it a star!

About

πŸͺ– AI-powered traffic surveillance system using YOLOv12 for real-time helmet detection & OCR-based number plate recognition | FastAPI + Next.js

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors