How mhliao/db works
Project type and purpose
• This is an open-source scene text detection framework (DBNet and DBNet++) implemented in PyTorch. It provides data-loading, model definition, training, inference/demo, evaluation, visualization, and custom CUDA operators for deformable convolutions.
File structure
• Top-level scripts:
• train.py, trainer.py – orchestrate the training loop.
• demo.py, eval.py, convert_to_onnx.py – handle inference, evaluation, and model export.
• experiment.py – utility for running experiments from YAML configs.
• Core modules:
• structure/ – builds the detection model (builder.py, model.py), plus representers, visualizers, measurers for outputs.
• backbones/ – CNN backbone definitions (ResNet, MobileNetV3).
• decoders/ – heads and loss functions (segmentation detector, various loss terms).
• data/ – data loading, augmentation, processing pipelines, dataset wrappers.
• training/ – checkpointing, learning-rate schedules, optimizer & scheduler.
• Utilities and evaluation:
• concern/ – logging, monitoring, ICDAR evaluation protocols, WebCV server for live visualization.
• assets/ops/dcn/ – custom CUDA extensions for deformable conv/pool operators.
• experiments/ – YAML config files that tie together dataset paths, model settings, hyperparameters.
README for additional insights
• The YAML configs (“base_*.yaml” and dataset-specific overrides) define the end-to-end pipeline: data preprocessing, model architecture, training parameters, inference settings, thresholds.
• Installation instructions emphasize building the deformable convolution operator.
• Demo and eval commands illustrate the flow from input images → inference → post-processing → evaluation metrics/visual results.
Detail without overthinking
• Break the system into: Data, Model, Training, Inference, Evaluation, Configuration, Custom Ops
• Essential directories as components; show their interactions clearly