Complete the new verification layer for simple-outline templates.
- dino_dense_matcher.py: DINOv2 dense sliding-window matcher with a fast
NCC scale probe. Activates as Pass C in detect_auto only when the pattern
appears larger than the template (probe_s > 1.10) — the regime NCC's
[0.30-1.0] scale grid structurally cannot reach.
- pipeline.py: gate Pass C behind a new `use_dino_dense` config flag
(default True; preserves the validated 10/10 behaviour).
- dino_verifier.py: embed_crops_normalized() for orientation-invariant
prototype/dense embeddings.
- Remove clip_verifier.py: model_survey benchmark showed CLIP image-to-image
gives no FP separation over DINOv2, and text-guided mode breaks zero-shot.
- model_survey.md: record the CLIP finding and the DINODense A/B result
(ON==OFF on all 2 examples + 6 real drawings; dense is a dormant
scale-invariant fallback for the untested larger-than-template case).
- scripts/eval_all.py, eval_drawings.py: A/B evaluation harnesses.
…
feat: XOR/XNOR gate discrimination via output-bubble filter
Duy
beec8a6
- Add filter_output_bubble() to Postprocessor: probes the right-center
region of template and candidates for a compact filled blob (bubble).
Bidirectional: rejects XNOR when XOR pattern given, and vice versa.
- Auto-detect scale range in complex template micro passes: small scales
[0.30-0.60] added only when standard passes find 0 NCC candidates,
indicating drawing instances are much smaller than the template (e.g.
gate symbols at ~40% template size). Prevents extra FPs for BR/resistors.
- Bubble filter gated on _no_std_candidates AND gate-like AR (0.25-2.0)
to avoid false rejection for bridge rectifiers and elongated templates.
Result: XOR gate detection finds exactly 5 (4 circuit + 1 notes icon),
XNOR gates correctly excluded. All 10 unit tests pass. Existing cases
(resistor x10, BR x4, example2 x4) unaffected.
feat: Zero-shot pattern detection pipeline for engineering BOM drawings
Duy
7d835bb
Pipeline: NCC multi-scale (Stage 1) + DINOv2 ViT-S/14 (Stage 2) + structural filters
- Auto-classify templates as simple (outline, e.g. resistor) or complex (e.g. bridge rectifier)
- Simple path: Chamfer pre-filter + hybrid DINOv2 bypass for borderline candidates
- Complex path: dual micro-pass (0deg + 90deg) with DINOv2 derotate=True
- FastAPI web UI with PaceOS-style dashboard
- HuggingFace Spaces Docker deployment ready
Results: Drawing 1 (resistor) 10 detections, Drawing 4 (BR) 4 detections,
Example 1 10 detections, Example 2 4 detections. All 10 unit tests pass.