π Version 1.1 β Improved Car Name Recognition Model
Multi-Task Vehicle Monitoring System
This is the second stable version of the Multi-Task Vehicle Monitoring System:
A versatile and real-time tool for Vehicle Recognition, Model Recognition, Color Recognition, Persian License Plate OCR, City Extraction and Accident Detection in streaming videos, images or webcam feeds.
Built on a strong deep learning backbone (YOLOv8/YOLOv11, ResNet18, PyTorch) and optimized OpenCV pipelines, the system provides accurate and multi-modal vehicle analysis tailored to Iranian traffic and datasets.
π Key Features
- Vehicle Recognition (YOLOv11)
Accurate recognition of Iranian vehicles in various scenarios, day and night.
- Car Brand and Model Classification (ResNet18)
Predicts the class among 27 supported Iranian car models/brands and displays it above each bounding box.
- Car Color Recognition (ResNet18, 12 colors)
Distinct color classification is presented as colored borders and text on the recognition boxes.
- Persian License Plate City OCR and Search
Reads Persian numbers and characters, finds the city of registration via internal database.
- Crash Detection (Collision Detection System)
Real-time crash inference; draws a bold red box, issues an audio alert (beep.mp3).
-
Multiple input modes:
-
Image file
-
Video file
Webcam / Live camera (Desktop only)
-
Real-time FPS display
The frame processing speed is continuously reported in the output video. -
Output saving:
Annotated images/videos are automatically saved with timestamped filenames in theoutput/directory.
Easy configuration:
PATHS, THRESHOLDS and IMG_SIZE are modularized for quick setup and expansion.
π Supported vehicle classes
-
27 Iranian car models/brands:
-
Full list of classes is available in the README and code.
π Model Accuracy and Criteria
-
Model:
car_name_model.pth(ResNet18, 27 classes) -
Exact results in README section "π Model Evaluation"
π Dataset
-
Image/Video Source:
-
Iranian Market Platforms: IranKhodro, Saipa, Divar, Bama
-
Public Dataset via Roboflow
-
City License Plate Data:
Search provided via Plates/city_plateinfo.txt
π Sound Alerts
- Accident alerts via
sound/beep.mp3(open, replaceable).
π₯οΈ Installation
Requirements:
- Python β₯ 3.8
- PyTorch (CUDA optional but recommended for live FPS)
- OpenCV, Timm, PaddleOCR, NumPy and other dependencies listed in
requirements.txt
Quick Installation:
- Place all pre-trained weights in
weights/folder (see README)
π‘ Usage Guide
1. Image:
- Set
PATHS["source"] = "yourimage.jpg" - Output saved in
output/
2. Video:
- Set
PATHS["source"] = "yourvideo.mp4" - Play or process via GUI; output saved automatically
3. Webcam/Live Streaming:
- Set
PATHS["source"] = 0(USB camera index) - Real-time detection with optional display (
cv2.imshow) - Exit: Press
Q
π Sample Outputs
-
Annotated sample images and videos (see the "Sample Outputs" section in the README ) including:
-
Overlapping vehicle detection
-
License plate and city identification
-
Color-coded vehicle detection
-
Collision inference
π€ Contribution
Pull requests welcome!
- Fork the repository
- Create your feature branch (
git checkout -b feature/MyFeature) - Commit and push
- Open a PR
Github.com/RezaGooner