CoolFace
Modelpublic

BesirVelioglu/id-card-detection-rd-report

sourceHugging Faceupdated 5mo agoView on Hugging Face
0likes
Model Card

ID Card Detection, Tracking & Re-Identification — R&D Report & Prototype

Overview

This repository contains a comprehensive R&D investigation into the best modern approaches for real-time ID card detection, tracking, re-identification, and reference matching from mobile/video input, plus a working prototype implementation.

Contents

  • `RD_REPORT.md` — Full R&D report (50+ pages) covering:
  • Current system critique and limitations
  • Latest research findings (30+ papers, 2022-2026)
  • Dataset evaluation table
  • 3 architecture options (Edge / Production / Research-grade)
  • Final architecture recommendation
  • Experiment design and metrics
  • Synthetic data generation pipeline
  • Training and fine-tuning recipes
  • Implementation roadmap
  • `enhanced/` — Prototype implementation:
  • config.py — Full configuration system with Edge/Production/Research presets
  • detector.py — YOLOv11 / D-FINE / RT-DETR detector with mock fallback
  • tracker.py — OC-SORT multi-object tracker (replaces ByteTrack)
  • feature_extractor.py — DINOv2 embedding extractor
  • reid_manager.py — EMA gallery for card re-entry detection
  • reference_matcher.py — SuperPoint + LightGlue reference matching
  • quality_scorer.py — Card quality assessment
  • pipeline.py — End-to-end pipeline orchestration
  • `scripts/` — Evaluation and data generation:
  • evaluate_detection.py — mAP, precision/recall evaluation
  • evaluate_tracking.py — MOTA, IDF1, ID-switch metrics
  • evaluate_reid.py — ROC/AUC, CMC, EER evaluation
  • generate_synthetic_cards.py — Privacy-safe synthetic ID card generator
  • `tests/` — Integration tests:
  • test_system.py — 68 tests covering all components

Recommended Architecture (Option B: Balanced Production)

ComponentModelHF ModelLatency
DetectorD-FINE-SFine-tune from D-FINE GitHub3.5ms (T4)
TrackerBoT-SORT-ReIDCustom + DINOv2~5ms
Re-IDDINOv2-base`facebook/dinov2-base`~15ms
Reference MatchSuperPoint + LightGlue`ETH-CVG/lightglue_superpoint`sub-10ms
Total~25ms

Quick Start

python
from enhanced.config import PipelineConfig
from enhanced.pipeline import IDCardPipeline

config = PipelineConfig.production_config()
pipeline = IDCardPipeline(config)

# Process a frame
result = pipeline.process_frame(frame)
for card in result.cards:
    print(f"Card {card.track_id}: {card.quality_label} (conf={card.confidence:.2f})")

Tests

bash
pip install opencv-python-headless numpy faker
python tests/test_system.py
# Expected: 68/68 passed

Key Research References

  1. 1.D-FINE (arxiv:2410.13842) — Detection
  2. 2.OC-SORT (arxiv:2203.14360) — Tracking
  3. 3.BoT-SORT (arxiv:2206.14651) — ReID Tracking
  4. 4.DINOv2 (arxiv:2304.07193) — Instance Embeddings
  5. 5.LightGlue (arxiv:2306.13643) — Feature Matching
  6. 6.SAM2MOT (arxiv:2504.04519) — Research-grade Tracking
  7. 7.DocXPand (arxiv:2407.20662) — Synthetic Data

License

Research prototype — see individual model licenses.