From d8ca358ae87d76e3eb02de1d85e41a8db788656d Mon Sep 17 00:00:00 2001 From: Nikos Livathinos Date: Thu, 28 Aug 2025 13:45:33 +0200 Subject: [PATCH] chore: Add debugging logs in LayoutModel Signed-off-by: Nikos Livathinos --- docling/models/layout_model.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/docling/models/layout_model.py b/docling/models/layout_model.py index 1879da40..c9db93ec 100644 --- a/docling/models/layout_model.py +++ b/docling/models/layout_model.py @@ -205,12 +205,30 @@ class LayoutModel(BasePageModel): conv_res, page, clusters, mode_prefix="raw" ) + ################################################################################# + # Debug: Print the un-processed clusters + # + for i, cl in enumerate(clusters): + print( + f"{i}: Cluster: {cl.id} | {cl.label} | {cl.bbox} | {cl.confidence}" + ) + ################################################################################# + # Apply postprocessing processed_clusters, processed_cells = LayoutPostprocessor( page, clusters, self.options ).postprocess() # Note: LayoutPostprocessor updates page.cells and page.parsed_page internally + ################################################################################# + # Debug: Print the processed clusters + # + for i, cl in enumerate(processed_clusters): + print( + f"{i}: Processed Cluster: {cl.id} | {cl.label} | {cl.bbox} | {cl.confidence}" + ) + ################################################################################# + with warnings.catch_warnings(): warnings.filterwarnings( "ignore",