How dmmaze/comic-text-detector works
Project type and purpose
• This is an open‐source machine‐learning training and inference toolkit for text‐detection and segmentation in manga/comics.
• It provides data generation/preprocessing, dataset interfaces, model definitions (DBNet, UNet, YOLOv5), training scripts (for DBNet, segmentation, YOLO-based block detection), and an inference pipeline.
File structure
• Top‐level scripts:
• train_db.py, train_seg.py, train_db_hyp.yaml, train_hyp.yaml, training_hyp.yaml
• train_db.py—DBNet training; train_seg.py—text‐segmentation training; inference.py—inference pipeline
• examples.ipynb—end‐to‐end tutorial
• Data directories:
• data/doc—sample inputs & outputs
• data/examples/fonts, data/examples—resources for synthetic rendering
• data/*.yaml—training hyperparameter configs
• Model definitions:
• basemodel.py—abstract model wrapper
• models/yolov5/*—YOLOv5 block detector integration
• Dataset interfaces:
• db_dataset.py—DBNet dataset loader
• seg_dataset.py—segmentation dataset loader
• Utility modules (utils/):
• db_utils, imgproc_utils, text_rendering, loss, export, general, io_utils, textblock, textmask, weight_init, yolov5_utils
Extract insights from the README
• Uses pre‐trained text detector from manga-image-translator
• Generates weak‐supervision labels (text‐lines, masks) via external DL tools
• Has three major pipelines:
a. Synthetic data generation (text_rendering + mask generation)
b. Text‐block detection training (YOLOv5)
c. Text segmentation & line‐detection training (DBNet / UNet approach)
• Inference stitches these to detect bboxes, lines, pixel‐masks.