Project Overview:
HelmetSecure AI is a cutting-edge AI-driven system that combines YOLO12 object detection with Gemini’s powerful vision-language analysis to detect and process helmet violations and number plates from video footage. The system not only tracks individuals in real time but also uses Google Gemini to extract number plates from detected vehicles, enabling automation in traffic monitoring, safety enforcement, and license plate logging.
This solution is tailored for road safety enforcement, automated vehicle documentation, and AI-based surveillance systems.
Key Features:
-
YOLO12 Object Detection: Custom-trained YOLO12 model accurately detects helmets, no-helmet violations, and number plates.
-
Track-by-ID System: Assigns persistent track IDs to each object (e.g., rider, plate) to avoid redundant processing.
-
Real-Time Number Plate Extraction: Gemini Vision Language Model extracts number plate text from cropped image regions.
-
Logging to File: Recognized plate numbers are logged with timestamps and associated track IDs.
-
Interval-Based Inference: Avoids repeated analysis using a controlled time delay per object.
-
Multithreaded Gemini Inference: Ensures smooth video processing by running image-to-text conversion in parallel threads.
-
Color-Coded Visual Alerts:
-
🟡 Yellow Box = No Helmet
-
🔴 Red Box = Number Plate
-
🟢 Green Box = Other Detections
-
Tech Stack:
| Tool / Library | Role |
|---|---|
| Python | Programming Language |
| OpenCV | Video processing, image handling |
| Ultralytics YOLO12 | Real-time object detection & tracking |
| LangChain + Gemini Pro | Vision-based language model integration |
| cvzone (optional) | UI annotation support |
| Threading | Parallel inference for smoother video |
| Base64 | Image conversion for Gemini API |
Use Cases:
-
Traffic Law Enforcement: Detect riders without helmets and log their number plates automatically.
-
Smart Surveillance Systems: Analyze live CCTV feeds for road violations.
-
Data Logging for Analytics: Maintain structured logs of all number plate detections.
-
Helmet Compliance Monitoring: Easily identify non-compliant riders in real-time.
Project Workflow Summary:
-
Load YOLO12 model (
best.pt) for detecting helmets, no-helmets, and number plates. -
Process video frame-by-frame, tracking object IDs.
-
For each number plate detected:
-
Crop the plate image.
-
Resize and convert it to base64 format.
-
Send it to Gemini via LangChain for OCR and text extraction.
-
Log the recognized plate with timestamp and track ID.
-
-
Visual annotations highlight violations and track objects.
-
Interface runs in real-time with asynchronous Gemini calls.
Conclusion:
Helmet Secure AI bridges the gap between real-time object detection and AI-driven text extraction, enabling law enforcement, smart cities, and safety systems to automatically detect and respond to helmet violations and capture vehicle information. Its seamless integration of YOLO12 and Gemini makes it a powerful, scalable, and intelligent traffic monitoring tool.

Reviews
There are no reviews yet.