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 <mly@zurich.ibm.com>
Co-authored-by: Maksym Lysak <mly@zurich.ibm.com>
This commit is contained in:
Maxim Lysak 2025-04-25 12:34:12 +02:00 committed by GitHub
parent c67133dde4
commit 94d66a0765
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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)