OpenOCR icon indicating copy to clipboard operation
OpenOCR copied to clipboard

filter_overlap_boxes in infer_doc.py

Open MarioKuzmanov-work opened this issue 8 months ago • 1 comments

Hi,

In infer_doc.OpenDoc.get_layout_parsing_results you do:

for i, (image, layout_det_res, imgs_in_doc_for_img) in enumerate(zip(images, layout_det_results, imgs_in_doc)):
      layout_det_res = filter_overlap_boxes(layout_det_res)

but your filter_overlap_boxes has the following signature:

def filter_overlap_boxes(
    layout_det_res: Dict[str, List[Dict]], layout_shape_mode: str
) -> Dict[str, List[Dict]]:

Therefore, two required arguments, not one. The error I get is:

TypeError: filter_overlap_boxes() missing 1 required positional argument: 'layout_shape_mode'

As a workaround, I am setting layout_shape_mode="". Is there something that I am missing?

openocr-python==0.1.5 paddlex==3.4.2 paddlepaddle==3.2.0 paddleocr==3.4.0

MarioKuzmanov-work avatar Mar 11 '26 14:03 MarioKuzmanov-work

Please refer to the versions of the following packages: paddleocr 3.3.2 paddlepaddle-gpu 3.2.0 paddlex 3.3.12

Topdu avatar Mar 18 '26 09:03 Topdu