PyTorch port of DBNet learns where the text is, fast
A PyTorch re-implementation of DBNet that wraps the differentiable-binarization text detector in a configurable training and inference pipeline.

What it does
This is a PyTorch rebuild of DBNet, a convolutional approach to finding text in natural-scene images. You feed it folders of photos and quadrilateral ground-truth annotations in plain .txt files; it learns to predict text boundaries and can evaluate against the ICDAR 2015 benchmark. The repo covers training, testing, and batch inference, with support for both single-GPU and multi-GPU setups.
The interesting bit
The README does not explain the differentiable binarization algorithm itself — that is left to the arXiv paper — but the performance table reveals the practical trade-offs. A ResNet-18 backbone hits 43 FPS at an 80.6 F-measure, while ResNet-50 pushes 82.24 F-measure at 27 FPS, letting you tune for latency or accuracy on standard hardware.
Key highlights
- Supports ResNet-18, ResNet-50, and ResNeSt-50 backbones paired with an FPN and DB head
- Achieves up to ~43 FPS with ResNet-18 (80.6 F-measure) or ~27 FPS with ResNet-50 (82.24 F-measure) on ICDAR 2015
- Includes single-GPU and multi-GPU training scripts, plus batch inference over image folders
- Grayscale training mode available by removing
dataset.args.transforms.Normalizefrom the config - Ground truth uses a simple quadrilateral
.txtformat: eight coordinates plus annotation
Caveats
- Several sections are marked “TBD” (download links and example images), and the author notes the project is “still under development”
- The README does not explain the differentiable binarization algorithm; it assumes you have read the paper
- Performance lags slightly behind the paper’s reported numbers on equivalent backbones (e.g., 43 FPS vs. 48 FPS)
Verdict
Worth a look if you need a trainable PyTorch scene-text detector and can tolerate a work-in-progress codebase. Skip it if you want polished documentation, pre-trained download links, or a turnkey API.
Frequently asked
- What is WenmuZhou/DBNet.pytorch?
- A PyTorch re-implementation of DBNet that wraps the differentiable-binarization text detector in a configurable training and inference pipeline.
- Is DBNet.pytorch open source?
- Yes — WenmuZhou/DBNet.pytorch is open source, released under the Apache-2.0 license.
- What language is DBNet.pytorch written in?
- WenmuZhou/DBNet.pytorch is primarily written in Python.
- How popular is DBNet.pytorch?
- WenmuZhou/DBNet.pytorch has 1k stars on GitHub.
- Where can I find DBNet.pytorch?
- WenmuZhou/DBNet.pytorch is on GitHub at https://github.com/WenmuZhou/DBNet.pytorch.