Layout-Parser / layout-parser

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

Colab: #108

Closed DimIsaev closed 2 years ago

DimIsaev commented 2 years ago

Describe the bug

<ipython-input-7-22403b0e7bb6> in <module>()
----> 1 model = lp.Detectron2LayoutModel('lp://PubLayNet/faster_rcnn_R_50_FPN_3x/config', 
      2                                  extra_config=["MODEL.ROI_HEADS.SCORE_THRESH_TEST", 0.8],
      3                                  label_map={0: "Text", 1: "Title", 2: "List", 3:"Table", 4:"Figure"})
      4     # Load the deep layout model from the layoutparser API
      5     # For all the supported model, please check the Model

/usr/local/lib/python3.7/dist-packages/layoutparser/file_utils.py in __getattr__(self, name)
    224             value = getattr(module, name)
    225         else:
--> 226             raise AttributeError(f"module {self.__name__} has no attribute {name}")
    227 
    228         setattr(self, name, value)

AttributeError: module layoutparser has no attribute Detectron2LayoutModel```

To Reproduce

model = lp.Detectron2LayoutModel('lp://PubLayNet/faster_rcnn_R_50_FPN_3x/config', 
                                 extra_config=["MODEL.ROI_HEADS.SCORE_THRESH_TEST", 0.8],
                                 label_map={0: "Text", 1: "Title", 2: "List", 3:"Table", 4:"Figure"})

Environment Colab (CPU) Env: Python3

DimIsaev commented 2 years ago

Install Detectron2 solved the problem