File tree Expand file tree Collapse file tree
docling_cvat_tools/cvat_tools Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1389,10 +1389,19 @@ def _process_table_data(self):
13891389 page_no = self .tabular_data [tind ]["page_no" ]
13901390 page_height = self .doc .pages [page_no ].size .height
13911391
1392+ existing_table_children = list (table_item .children )
13921393 table_item .children = []
13931394 all_items = []
1395+ seen_item_refs : Set [str ] = set ()
1396+ for item_ref in existing_table_children :
1397+ if item_ref .cref not in seen_item_refs :
1398+ seen_item_refs .add (item_ref .cref )
1399+ all_items .append (item_ref )
13941400 for item , _ in self .doc .iterate_items (page_no = page_no ):
1395- all_items .append (item .get_ref ())
1401+ item_ref = item .get_ref ()
1402+ if item_ref .cref not in seen_item_refs :
1403+ seen_item_refs .add (item_ref .cref )
1404+ all_items .append (item_ref )
13961405
13971406 for c in table_cell_data :
13981407 # Get text to populate TableData
You can’t perform that action at this time.
0 commit comments