From 94d66a076559c4e48017bd619508cfeef104079b Mon Sep 17 00:00:00 2001 From: Maxim Lysak <101627549+maxmnemonic@users.noreply.github.com> Date: Fri, 25 Apr 2025 12:34:12 +0200 Subject: [PATCH] fix: Incorrect scaling of TableModel bboxes when do_cell_matching is False (#1459) fixing double scaling in case of do_cell_matching is False Signed-off-by: Maksym Lysak Co-authored-by: Maksym Lysak --- docling/models/table_structure_model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docling/models/table_structure_model.py b/docling/models/table_structure_model.py index 44579b9..1a3f900 100644 --- a/docling/models/table_structure_model.py +++ b/docling/models/table_structure_model.py @@ -267,7 +267,7 @@ class TableStructureModel(BasePageModel): element["bbox"]["token"] = text_piece tc = TableCell.model_validate(element) - if self.do_cell_matching and tc.bbox is not None: + if tc.bbox is not None: tc.bbox = tc.bbox.scaled(1 / self.scale) table_cells.append(tc)