mirror of
https://github.com/DS4SD/docling.git
synced 2025-12-08 20:58:11 +00:00
chore: Add debugging logs in LayoutModel
Signed-off-by: Nikos Livathinos <nli@zurich.ibm.com>
This commit is contained in:
@@ -205,12 +205,30 @@ class LayoutModel(BasePageModel):
|
|||||||
conv_res, page, clusters, mode_prefix="raw"
|
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
|
# Apply postprocessing
|
||||||
processed_clusters, processed_cells = LayoutPostprocessor(
|
processed_clusters, processed_cells = LayoutPostprocessor(
|
||||||
page, clusters, self.options
|
page, clusters, self.options
|
||||||
).postprocess()
|
).postprocess()
|
||||||
# Note: LayoutPostprocessor updates page.cells and page.parsed_page internally
|
# 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():
|
with warnings.catch_warnings():
|
||||||
warnings.filterwarnings(
|
warnings.filterwarnings(
|
||||||
"ignore",
|
"ignore",
|
||||||
|
|||||||
Reference in New Issue
Block a user