Skip to content

Commit 527d63b

Browse files
committed
fix(layout,table): update e2e test
Signed-off-by: Clément Doumouro <[email protected]>
1 parent b52790d commit 527d63b

36 files changed

+16110
-15552
lines changed

docling/models/ocr_mac_model.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,10 @@ def __call__(
107107
x2 = x1 + w * im_width
108108
y1 = y2 - h * im_height
109109

110-
left = x1 / self.scale
111-
top = y1 / self.scale
112-
right = x2 / self.scale
113-
bottom = y2 / self.scale
110+
left = x1 / self.scale + ocr_rect.l
111+
top = y1 / self.scale + ocr_rect.t
112+
right = x2 / self.scale + ocr_rect.l
113+
bottom = y2 / self.scale + ocr_rect.t
114114

115115
cells.append(
116116
TextCell(

docling/models/table_structure_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ def __call__(
260260
)
261261
new_bbox = _rotate_bbox(
262262
new_cell.to_bounding_box(),
263-
orientation=-cells_orientation,
263+
orientation=cells_orientation,
264264
im_size=scaled_page_im.size,
265265
).model_dump()
266266
tokens.append(
Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
<document>
2-
<subtitle-level-1><location><page_1><loc_33><loc_87><loc_68><loc_91></location>This is a table test</subtitle-level-1>
3-
<paragraph><location><page_1><loc_12><loc_83><loc_61><loc_84></location>The test starts with some random text and then a table image:</paragraph>
4-
<paragraph><location><page_1><loc_45><loc_76><loc_56><loc_77></location>Some column</paragraph>
5-
<paragraph><location><page_1><loc_62><loc_76><loc_78><loc_77></location>Some other column</paragraph>
6-
<paragraph><location><page_1><loc_29><loc_70><loc_37><loc_71></location>Some row</paragraph>
7-
<paragraph><location><page_1><loc_47><loc_70><loc_54><loc_71></location>some cell</paragraph>
8-
<paragraph><location><page_1><loc_65><loc_70><loc_76><loc_71></location>have content</paragraph>
9-
<paragraph><location><page_1><loc_26><loc_64><loc_39><loc_65></location>Some other row</paragraph>
10-
<paragraph><location><page_1><loc_46><loc_64><loc_55><loc_65></location>other don't</paragraph>
2+
<table>
3+
<location><page_1><loc_9><loc_45><loc_70><loc_86></location>
4+
<row_0><col_0><col_header>Vertically merged</col_0><col_1><col_header>Other merged column</col_1><col_2><col_header>Yet another column</col_2></row_0>
5+
<row_1><col_0><body>value</col_0><col_1><body>Some other value</col_1><col_2><body>Yet another value</col_2></row_1>
6+
<row_2><col_0><body>value</col_0><col_1><body>Some other value</col_1><col_2><body>Yet another value</col_2></row_2>
7+
</table>
118
</document>

0 commit comments

Comments
 (0)