You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe if you pip install Pillow==9.5.0, that can address the issue, although now I'm running into "AssertionError: Checkpoint .../model_final.pth not found!", so that's fun.
Code:
import layoutparser as lp
model = lp.Detectron2LayoutModel(
config_path ='lp://MFD/faster_rcnn_R_50_FPN_3x/config', # In model catalog
label_map ={0: "Text", 1: "Title", 2: "List", 3:"Table", 4:"Figure"}, # In model
label_map
extra_config=["MODEL.ROI_HEADS.SCORE_THRESH_TEST", 0.7] # Optional
)
layout = model.detect(image) # You need to load the image somewhere else, e.g., image = cv2.imread(...)
lp.draw_box(image, layout, box_width=5, show_element_type=True)
Error:
AttributeError Traceback (most recent call last)
in <cell line: 2>()
1 import layoutparser as lp
----> 2 model = lp.Detectron2LayoutModel(
3 config_path ='lp://MFD/faster_rcnn_R_50_FPN_3x/config', # In model catalog
4 label_map ={0: "Text", 1: "Title", 2: "List", 3:"Table", 4:"Figure"}, # In model
label_map
5 extra_config=["MODEL.ROI_HEADS.SCORE_THRESH_TEST", 0.7] # Optional
16 frames
/usr/local/lib/python3.10/dist-packages/detectron2/data/transforms/transform.py in ExtentTransform()
44 """
45
---> 46 def init(self, src_rect, output_size, interp=Image.LINEAR, fill=0):
47 """
48 Args:
AttributeError: module 'PIL.Image' has no attribute 'LINEAR'
The text was updated successfully, but these errors were encountered: