Layout-Parser/layout-parser

inconsistent num classes in PrimaLayout

bertsky opened this issue · 0 comments

The configuration for the PrimaLayout MRCNN Detectron2 model …

"mask_rcnn_R_50_FPN_3x": "https://www.dropbox.com/s/yc92x97k50abynt/config.yaml?dl=1"

… contains a setting MODEL.ROI_HEADS.NUM_CLASSES: 7.

But LP's actual runtime config for the label map of the region types contains only 6 classes:

"PrimaLayout": {
1: "TextRegion",
2: "ImageRegion",
3: "TableRegion",
4: "MathsRegion",
5: "SeparatorRegion",
6: "OtherRegion",
},

According to the converter for training on PRImA …
https://github.com/Layout-Parser/layout-model-training/blob/b9fad076596272e427612d5e848da1ba8ea06b97/tools/convert_prima_to_coco.py#L36-L64

… the difference is in the background class (0).

IMO that's an error (either in the Detectron2 config file, or in LP catalog's label map). It does not show as an error, but instead of class strings you'll just get the class number for the additional/missing class 0.