From d0817f5744f4e78f3880d1ea87423e8260da9a81 Mon Sep 17 00:00:00 2001 From: Robert Sachunsky Date: Wed, 24 Sep 2025 12:08:50 +0200 Subject: [PATCH 1/4] fix typo --- src/eynollah/eynollah.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/eynollah/eynollah.py b/src/eynollah/eynollah.py index 73d07b5..2813c56 100644 --- a/src/eynollah/eynollah.py +++ b/src/eynollah/eynollah.py @@ -5091,7 +5091,7 @@ class Eynollah: t_order = time.time() if self.full_layout: - self.logger.info(ep 4/5: Reading Order Detection") + self.logger.info("Step 4/5: Reading Order Detection") if self.reading_order_machine_based: self.logger.info("Using machine-based detection") From 7933b103f5378f025eda2f5347095ee26e3eb159 Mon Sep 17 00:00:00 2001 From: Robert Sachunsky Date: Wed, 24 Sep 2025 12:09:30 +0200 Subject: [PATCH 2/4] log modes only once (in run, not in run_single) --- src/eynollah/eynollah.py | 35 ++++++++++++++++------------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/src/eynollah/eynollah.py b/src/eynollah/eynollah.py index 2813c56..82073c3 100644 --- a/src/eynollah/eynollah.py +++ b/src/eynollah/eynollah.py @@ -4531,6 +4531,21 @@ class Eynollah: self.logger.debug("enter run") t0_tot = time.time() + # Log enabled features directly + enabled_modes = [] + if self.light_version: + enabled_modes.append("Light version") + if self.textline_light: + enabled_modes.append("Light textline detection") + if self.full_layout: + enabled_modes.append("Full layout analysis") + if self.ocr: + enabled_modes.append("OCR") + if self.tables: + enabled_modes.append("Table detection") + if enabled_modes: + self.logger.info("Enabled modes: " + ", ".join(enabled_modes)) + if dir_in: self.ls_imgs = os.listdir(dir_in) self.ls_imgs = [ind_img for ind_img in self.ls_imgs if ind_img.endswith('.jpg') or ind_img.endswith('.jpeg') or ind_img.endswith('.png') or ind_img.endswith('.tif') or ind_img.endswith('.tiff') or ind_img.endswith('.JPG') or ind_img.endswith('.JPEG') or ind_img.endswith('.TIF') or ind_img.endswith('.TIFF') or ind_img.endswith('.PNG')] @@ -4563,25 +4578,7 @@ class Eynollah: def run_single(self): t0 = time.time() - self.logger.info(f"Processing file: {self.writer.image_filename}") - - # Log enabled features directly - enabled_modes = [] - if self.light_version: - enabled_modes.append("Light version") - if self.textline_light: - enabled_modes.append("Light textline detection") - if self.full_layout: - enabled_modes.append("Full layout analysis") - if self.ocr: - enabled_modes.append("OCR") - if self.tables: - enabled_modes.append("Table detection") - - if enabled_modes: - self.logger.info("Enabled modes: " + ", ".join(enabled_modes)) - - + self.logger.info(f"Processing file: {self.writer.image_filename}") self.logger.info("Step 1/5: Image Enhancement") img_res, is_image_enhanced, num_col_classifier, num_column_is_classified = self.run_enhancement(self.light_version) From 90f1d7aa47e481731e0ec021f9af070b8bf9a0fd Mon Sep 17 00:00:00 2001 From: Robert Sachunsky Date: Wed, 24 Sep 2025 12:10:11 +0200 Subject: [PATCH 3/4] rm summary msg (info already logged elsewhere) --- src/eynollah/eynollah.py | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/eynollah/eynollah.py b/src/eynollah/eynollah.py index 82073c3..ed2c9fb 100644 --- a/src/eynollah/eynollah.py +++ b/src/eynollah/eynollah.py @@ -5172,19 +5172,6 @@ class Eynollah: all_found_textline_polygons_marginals_left, all_found_textline_polygons_marginals_right, all_box_coord_marginals_left, all_box_coord_marginals_right, slopes, slopes_h, slopes_marginals_left, slopes_marginals_right, cont_page, polygons_lines_xml, ocr_all_textlines, ocr_all_textlines_h, ocr_all_textlines_marginals_left, ocr_all_textlines_marginals_right, ocr_all_textlines_drop, conf_contours_textregions, conf_contours_textregions_h) - summary = [ - f"Total processing time: {time.time() - t0:.1f}s", - f"Output file: {self.writer.output_filename}" - ] - - if self.ocr: - summary.append("OCR processing completed") - if self.full_layout: - summary.append("Full layout analysis completed") - if self.tables: - summary.append("Table detection completed") - self.logger.info(f"Summary: {summary}") - return pcgts contours_only_text_parent_h = None From 5bd318e6576858718f1953749cb448bd4a7dece0 Mon Sep 17 00:00:00 2001 From: Robert Sachunsky Date: Wed, 24 Sep 2025 12:14:32 +0200 Subject: [PATCH 4/4] rm print statement (already log msg) --- src/eynollah/eynollah.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/eynollah/eynollah.py b/src/eynollah/eynollah.py index ed2c9fb..27277ee 100644 --- a/src/eynollah/eynollah.py +++ b/src/eynollah/eynollah.py @@ -4555,7 +4555,6 @@ class Eynollah: raise ValueError("run requires either a single image filename or a directory") for img_filename in self.ls_imgs: - print(img_filename, 'img_filename') self.logger.info(img_filename) t0 = time.time()