[plugin] name = "license_plate_recognition" version = "5.3.0" display_name = "Nhận diện biển số xe" description = "Phát hiện và nhận diện biển số xe Việt Nam" library = "license_plate_recognition.dll" [capabilities] use_gpu = true use_batching = true use_tracking = true use_zone = true [classes] names = ["car", "motorbike", "truck", "bus"] defaults = ["car", "motorbike", "truck", "bus"] [models] # Order matters: the GUI's "Models" section binds `model_1` → files[0], # `model_2` → files[1], etc. The order below MUST match the schema in # `[[config.sections]]` labelled "MODELS" further down. Adding a new # entry here requires bumping the schema in lockstep. files = [ "mbfs_vehicle_det_v4.onnx", # model_1 — Detection (vehicle YOLO) "lp_detection_v4.onnx", # model_2 — Plate Detector "mbfsn_cls_brand_car_v1.onnx", # model_3 — Joint Make_Model classifier (80 classes, single softmax) "license_place_rec_crnn_v8.onnx", # model_4 — CRNN/CTC sequence OCR (v8, TBC layout, handles 1+2 line via LPTR-AFLNet preprocessing) "weight_detect_corner.onnx", # model_5 — 4-corner plate detector (perspective rectification) ] [inference] model = "mbfs_vehicle_det_v4.onnx" confidence = 0.5 nms = 0.45 input_size = 640 [models.plate_detector] model = "lp_detection_v4.onnx" kind = "yolo" input_size = 640 confidence = 0.3 nms = 0.45 # Joint Make_Model classifier (YOLOv8n-cls, 80 classes "{Make}_{Model}"). # Single softmax head; plugins split label on the first '_' to recover # brand vs model. Replaces the older two-head model (brand_logits 9 + # model_logits 72) — same datalake schema preserved. [models.vehicle_brand] model = "mbfsn_cls_brand_car_v1.onnx" kind = "classifier" input_size = 224 # CRNN/CTC sequence OCR (v8). Single model for both 1-line and 2-line # Vietnamese plates. # # 1-line: corner-warp the plate crop to 128×32, feed to CRNN. # 2-line: corner-warp to 128×64, split mid-row, resize each half to # 64×32, horizontally concatenate to 128×32 (LPTR-AFLNet # preprocessing — arXiv 2507.16362), feed to CRNN. # # v8 ONNX output layout is TBC = [T=31, B, C=32]; the host's ocr_seq # decoder auto-detects layout (BTC vs TBC) via shape introspection. # Class 0 is the CTC blank; classes 1..=31 map to chars in `vocab`. [models.plate_ocr_crnn] model = "license_place_rec_crnn_v8.onnx" kind = "ocr_seq" input_size = [128, 32] # [width, height] [models.plate_ocr_crnn.ocr_seq] vocab = "0123456789ABCDEFGHKLMNPRSTUVXYZ" channels = 1 # grayscale; host applies BT.601 luma + x/255.0 # 4-corner plate corner detector. YOLO classifier with 4 classes # (0=top_left, 1=top_right, 2=bottom_left, 3=bottom_right). The plugin # picks the highest-confidence box per class, interpolates the 4th # corner via the parallelogram rule when only 3 are present, then # calls `host.warp_perspective` to produce an axis-aligned canvas # before CRNN OCR. Falls back to the row_split.rs algorithm when # fewer than 3 corners are detected. [models.plate_corner] model = "weight_detect_corner.onnx" kind = "yolo" input_size = 320 confidence = 0.3 nms = 0.5 # ── Config page schema (data-driven GUI) ────────────────────────────────── [[config.sections]] title = "MODELS" fields = [ { key = "model_1", type = "model", label = "Vehicle Detector:" }, { key = "model_2", type = "model", label = "Plate Detector:" }, { key = "model_3", type = "model", label = "Vehicle Brand:" }, { key = "model_4", type = "model", label = "CRNN OCR Model (v8):" }, { key = "model_5", type = "model", label = "Corner Detector:" }, ] [[config.sections]] title = "DETECTION" fields = [ { key = "inference.confidence", type = "slider", label = "Vehicle Detection Confidence", help = "Primary YOLO vehicle detection confidence (0.0-1.0)", min = 0.0, max = 1.0, step = 0.05, default = 0.5 }, { key = "models.plate_detector.confidence", type = "slider", label = "Plate Detection Confidence", help = "Plate detector confidence threshold (0.0-1.0)", min = 0.0, max = 1.0, step = 0.05, default = 0.3 }, { key = "two_line_aspect_max", type = "slider", label = "2-Line Plate Aspect Threshold", help = "Plates with width/height below this are tried as 2-line first. Falls back to 1-line on failed validation. Lower = favor 1-line; higher = favor 2-line.", min = 1.5, max = 3.5, step = 0.1, default = 2.3 }, { key = "min_ocr_confidence", type = "slider", label = "Min Plate OCR Confidence", help = "Reject whole plate readings below this averaged per-character confidence (0.0-1.0)", min = 0.0, max = 1.0, step = 0.05, default = 0.3 }, ] [[config.sections]] title = "VEHICLE IDENTIFICATION" fields = [ { key = "vehicle_brand_enabled", type = "toggle", label = "Brand/Model Classifier", description = "Classify make and model on confirmed vehicle tracks", default = true }, { key = "vehicle_brand_classify_interval", type = "number", label = "Classify Interval", help = "Frames between brand+model classification (1-30)", min = 1, max = 30, step = 1, default = 5, visible_when = "vehicle_brand_enabled" }, { key = "vehicle_brand_min_confidence", type = "slider", label = "Min Brand Confidence", help = "Drop brand+model predictions below this joint-softmax confidence (80-class Make_Model head). 0.3 is a reasonable default; both brand and model receive the same confidence.", min = 0.0, max = 1.0, step = 0.05, default = 0.3, visible_when = "vehicle_brand_enabled" }, { key = "vehicle_model_min_confidence", type = "slider", label = "Min Model Confidence", help = "Legacy knob from the two-head classifier era. The new joint Make_Model classifier uses vehicle_brand_min_confidence only; this slider is currently inert.", min = 0.0, max = 1.0, step = 0.05, default = 0.1, visible_when = "vehicle_brand_enabled" }, ] [[config.sections]] title = "TRACKING" fields = [ { key = "tracker_min_observations", type = "number", label = "Min Observations", help = "Plate tracker observations before emitting result (1-10)", min = 1, max = 10, step = 1, default = 2 }, { key = "dedup_cooldown_secs", type = "float", label = "Dedup Cooldown", help = "Seconds before same plate re-triggers (1-120)", min = 1.0, max = 120.0, step = 1.0, suffix = "s", default = 10.0 }, ]