Skip to content

Commit 0f1da38

Browse files
author
Maksym Lysak
committed
Added skipping switch for 90 degree tables
Signed-off-by: Maksym Lysak <mly@zurich.ibm.com>
1 parent 4b74228 commit 0f1da38

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

docling_eval/dataset_builders/doclingsdg_builder.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
_MIN_PAGE_IMAGE_DIM = 32
5353
_MAX_PAGE_IMAGE_DIM = 4096
5454
_REGION_OVERLAP_IOU_THRESHOLD = 0.99
55+
_SKIP_ROTATED_90_TABLES = True
5556

5657
_TABLE_REGION_CATEGORY_IDS: Dict[str, int] = {
5758
"table": 1,
@@ -1736,6 +1737,16 @@ def iterate(self) -> Iterable[DatasetRecordWithBBox]:
17361737
)
17371738

17381739
if has_rotated_90:
1740+
if _SKIP_ROTATED_90_TABLES:
1741+
skipped_filtered += 1
1742+
filter_reason_counts["rotated_90_table"] = (
1743+
filter_reason_counts.get("rotated_90_table", 0) + 1
1744+
)
1745+
_log.warning(
1746+
"Skipping table sample %s: 90-degree rotated table detected.",
1747+
doc_id,
1748+
)
1749+
continue
17391750
tags.append("90_degree")
17401751
else:
17411752
ground_truth_bboxes = self._extract_top_level_bboxes(

0 commit comments

Comments
 (0)