Views
No views yet
2026-07-31 — the default weights changed.khmer_dbnet_mobilenetv3.onnxnow serves v2, a fine-tune on realistic ID-card/official-letter documents. It detects noticeably more text on real photographed documents than v1 did. The previous weights remain available unchanged askhmer_dbnet_mobilenetv3_v1.onnx— pin that file if you need the old behaviour.
| File | Description |
|---|---|
khmer_dbnet_mobilenetv3.onnx | Default. Currently identical to v2. Recommended for inference (torch-free, via onnxruntime) |
khmer_dbnet_mobilenetv3.pth | PyTorch checkpoint of the default — for fine-tuning or DBNet.pytorch-based inference |
khmer_dbnet_mobilenetv3_v2.onnx / .pth | v2 explicitly, pinned |
khmer_dbnet_mobilenetv3_v1.onnx / .pth | v1 explicitly, pinned — the original release |
pip install dbnet-text-detector1from dbnet_detector import DBNetDetector
2
3detector = DBNetDetector.from_pretrained() # current default (v2)
4boxes, scores = detector.detect("your_image.jpg")
5
6detector = DBNetDetector.from_pretrained("v1") # pin an older version
7detector = DBNetDetector.from_pretrained(preset="display") # large display text~/.cache/huggingface/hub).document preset (box_thresh=0.3, short_size=1088), which is
tuned for dense scanned or photographed pages. The older box_thresh=0.6, short_size=736
values silently dropped whole text lines on real documents — on one sample page, 24 detected
lines versus 79 with the current defaults.preset="display" (short_size=320). The model was trained on small
text lines inside 640px crops, so very large glyphs fall outside its training scale.| Version | Training | Val F1 |
|---|---|---|
| v1 | from scratch on plain synthetic docs | 0.987 (v1 val set) |
| v2 (default) | v1 fine-tuned on synthetic ID cards / official letters | 0.933 (v2 val set) |