Layout-Parser / layout-parser

A Unified Toolkit for Deep Learning Based Document Image Analysis
https://layout-parser.github.io/
Apache License 2.0
4.88k stars 467 forks source link

Misc improvements #21

Closed lolipopshock closed 3 years ago

lolipopshock commented 3 years ago
  1. When loading Layout Parser official models, Detectron2LayoutModel can automatically detect the label_map, . For example,

    model = lp.Detectron2LayoutModel("lp://HJDataset/faster_rcnn_R_50_FPN_3x/config")
    model.label_map
    # {1: 'Page Frame', ... }
  2. Detectron2LayoutModel now supports the enforce_cpu flag that enforces using cpu even when CUDA devices are available. Inspired by #16 .

  3. For visualization.daw_box, it now supports a show_element_type flag that shows the bbox category name on the top left corner of the layout objects.