From 03ca38379d0cd9ce32b1800fecfb81d68c7a2e13 Mon Sep 17 00:00:00 2001 From: Stefan Klut Date: Tue, 20 Feb 2024 16:08:30 +0100 Subject: [PATCH] Fix issue with not cleaning up the binary mask --- page_xml/xml_converter.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/page_xml/xml_converter.py b/page_xml/xml_converter.py index 0baf949..91da302 100644 --- a/page_xml/xml_converter.py +++ b/page_xml/xml_converter.py @@ -394,6 +394,8 @@ def build_top_bottom_sem_seg(self, page: PageData, out_size: tuple[int, int], li colored_top_bottom = np.where(top_bottom, top_color, bottom_color) sem_seg[line_pixel_coords[:, 1], line_pixel_coords[:, 0]] = colored_top_bottom + binary_mask.fill(0) + if total_overlap: self.logger.warning(f"File {page.filepath} contains overlapping top bottom sem_seg") if not sem_seg.any():