How manojbaniya444/minor-project-bct-iii-ii works
Project Type and Purpose
• This is a standalone, desktop-based computer vision/ML application (written in Python) that:
• Captures video or images via OpenCV
• Runs a YOLOv8 model for license-plate detection
• Performs character segmentation
• Classifies characters with a TensorFlow CNN
• Records results in a local SQLite database
• Presents a GUI front end with Tkinter
File Structure
• Top-level directories “ANPR FINAL” (production code) and “ANPR TEST” (development/test sandbox) each contain:
• app.py − application entry point and UI launcher
• actions.py / backup_actions.py − business-logic wrappers
• yolo_detect.py / yolo_predict.py − YOLO inference modules (using PyTorch)
• segment.py − plate-region segmentation routines
• classify.py / classify_class.py − character-classification logic (TensorFlow saved model)
• db.py − SQLite read/write layer (lpr.db)
• utils.py − shared helper functions
• images/ − sample inputs
• trained_models/ − YOLO weights (best.pt) and TF SavedModel artifacts
Extract Additional Architectural Insights from README
• Workflow description:
1. Video capture → YOLOv8 object detection
2. ROI extraction & plate cropping
3. Image transforms & contour-based character segmentation
4. CNN-based character classification (17 Nepali classes)
5. Persistence to SQLite via db.py
6. Real-time UI updates in Tkinter
Main Components
a. User Interface Layer
• Tkinter GUI (app.py)
• Displays video feed, detections, character outputs, status
b. Data Acquisition Layer
• OpenCV VideoCapture module (inside app.py or actions.py)
• Optionally file/image loader (images/ folder)
c. Detection Module
• YOLOv8 inference (yolo_detect.py / yolo_predict.py)
d. Segmentation Module
• segment.py
• Steps: perspective transform, cleaning, contour detection, character ROI isolation
e. Classification Module
• classify.py / classify_class.py
• TensorFlow SavedModel under trained_models/classification_model
• Outputs: character labels
f. Persistence Layer
• SQLite DB (lpr.db) via db.py
• Tables: plate metadata, character sequences, timestamps
g. Utility Layer
• utils.py for logging, image I/O, config parsing
Relationships and Data Flows
User → GUI → Video Stream → Detector → Plate ROI → Segmenter → Character ROIs → Classifier → Result → DB → GUI update
• Utils.py as a side component supplying helpers to all modules
• Bidirectional link between app.py (controller) and each module script
Architectural Patterns
• Pipeline pattern: each stage (capture, detect, segment, classify) forms a pipeline
• Modular code organization: separation of concerns (detection vs segmentation vs classification vs DB)
• MVC-like layering:
• Model: trained_models + db.py
• View: Tkinter GUI
• Controller: actions.py / app.py
Technologies and Frameworks
• GUI: Python Tkinter
• CV: OpenCV
• Detection: PyTorch + YOLOv8 (best.pt)
• Classification: TensorFlow SavedModel
• Storage: SQLite
• Scripting: Python 3.x (scripts in ANPR FINAL/*.py)