BesirVelioglu/id-card-detection-rd-report
0
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 presetsdetector.py— YOLOv11 / D-FINE / RT-DETR detector with mock fallbacktracker.py— OC-SORT multi-object tracker (replaces ByteTrack)feature_extractor.py— DINOv2 embedding extractorreid_manager.py— EMA gallery for card re-entry detectionreference_matcher.py— SuperPoint + LightGlue reference matchingquality_scorer.py— Card quality assessmentpipeline.py— End-to-end pipeline orchestration
- `scripts/` — Evaluation and data generation:
evaluate_detection.py— mAP, precision/recall evaluationevaluate_tracking.py— MOTA, IDF1, ID-switch metricsevaluate_reid.py— ROC/AUC, CMC, EER evaluationgenerate_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)
Quick Start
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
pip install opencv-python-headless numpy faker
python tests/test_system.py
# Expected: 68/68 passedKey Research References
- D-FINE (arxiv:2410.13842) — Detection
- OC-SORT (arxiv:2203.14360) — Tracking
- BoT-SORT (arxiv:2206.14651) — ReID Tracking
- DINOv2 (arxiv:2304.07193) — Instance Embeddings
- LightGlue (arxiv:2306.13643) — Feature Matching
- SAM2MOT (arxiv:2504.04519) — Research-grade Tracking
- DocXPand (arxiv:2407.20662) — Synthetic Data
License
Research prototype — see individual model licenses.
