Mask R-CNN R-50-FPN trained on the BaDLAD training set for Bengali document layout
analysis (instance segmentation track). Matches the paper’s Mask R-CNN / ImageNet
setup used for mask mAP reporting.
1from detectron2 import model_zoo
2from detectron2.config import get_cfg
3from detectron2.engine import DefaultPredictor
4from huggingface_hub import hf_hub_download
5
6weights = hf_hub_download("bengaliAI/badlad-mrcnn-paper", "model_final.pth")
7
8cfg = get_cfg()
9cfg.merge_from_file(
10 model_zoo.get_config_file("COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml")
11)
12cfg.MODEL.ROI_HEADS.NUM_CLASSES = 4
13cfg.MODEL.WEIGHTS = weights
14cfg.MODEL.ROI_HEADS.SCORE_THRESH_TEST = 0.05
15predictor = DefaultPredictor(cfg)
Re-run on the paper hidden test (13 328 images). Primary metric: COCO mask AP@[.5:.95],
score_thresh=0.05.
1@inproceedings{shihab2023badlad,
2 title = {{BaDLAD}: A Large Multi-Domain {Bengali} Document Layout Analysis Dataset},
3 author = {Shihab, Md. Istiak Hossain and Hasan, Md. Rakibul and Emon, Mahfuzur Rahman and Hossen, Syed Mobassir and Ansary, Md. Nazmuddoha and Ahmed, Intesur and Rakib, Fazle Rabbi and Dhruvo, Shahriar Elahi and Dip, Souhardya Saha and Pavel, Akib Hasan and Meghla, Marsia Haque and Haque, Md. Rezwanul and Chowdhury, Sayma Sultana and Sadeque, Farig and Reasat, Tahsin and Humayun, Ahmed Imtiaz and Sushmit, Asif Shahriyar},
4 booktitle = {Proceedings of the 17th International Conference on Document Analysis and Recognition (ICDAR)},
5 year = {2023},
6 url = {https://arxiv.org/abs/2303.05325},
7}