Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
310e44a
Alternative implementation of processing elements in a linear order r…
Jan 8, 2026
429b114
Updated fixtures (re-gen expected.json, updated xmls from 25-34)
Jan 8, 2026
d322a2b
fixing precommit issue
Jan 12, 2026
7295477
Add tree txt output
cau-git Jan 12, 2026
3b97d69
Fixed issue with rich table cells for the cvat_to_docling_linear, upd…
Jan 12, 2026
0a8c3ba
Add fixtures 35, 36, 37
cau-git Jan 12, 2026
efbc915
Add fixtures 38, 39
cau-git Jan 12, 2026
8f0decd
Add fixtures 40, fixes for others.
cau-git Jan 12, 2026
423ab92
Correct fixtures 38, 39 images
cau-git Jan 13, 2026
afb1a01
Fixed list hierarchy for cvat_to_docling_linear
Jan 13, 2026
78389d8
Add fixtures 40, 41
cau-git Jan 13, 2026
e57ea52
Add fixtures 41, 42
cau-git Jan 13, 2026
29b1f33
Scoping each table rows / columns (and other regions) for nested tabl…
Jan 13, 2026
bcb0275
Add fixture 43a, 43b
cau-git Jan 13, 2026
f0ead41
Fixed nested tables in cvat_to_docling_linear
Jan 13, 2026
a069faa
computed expected.json to latest fixtures
Jan 13, 2026
59e7a3d
Added proper handling of the interleaved text (or other elements unre…
Jan 13, 2026
181b627
Move linear cvat_to_docling version as default
cau-git Jan 14, 2026
49337e8
Fix for footnotes that linked as captions that lead to duplicated ele…
Jan 14, 2026
5def41b
precommit fix
Jan 14, 2026
03d9690
Fix for the proper grouping of the lists in the rich table cells
Jan 14, 2026
d700eea
Fix to account table rotation for table cell bounding boxes...
Jan 14, 2026
a8c8cfa
Fixed case with rotated table
Jan 14, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
706 changes: 672 additions & 34 deletions docling_cvat_tools/cvat_tools/cvat_to_docling.py

Large diffs are not rendered by default.

18 changes: 16 additions & 2 deletions docling_cvat_tools/cvat_tools/path_mappings.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,15 @@ def map_path_points_to_elements(
f"Caption path {path.id}: Backwards annotation detected, auto-correcting"
)
container_id, caption_id = caption_id, container_id
container_el, caption_el = caption_el, container_el

to_caption[path.id] = (container_id, caption_id)
if caption_el and is_footnote_element(caption_el):
logger.debug(
f"Caption path {path.id}: Target is footnote, treating as to_footnote"
)
to_footnote[path.id] = (container_id, caption_id)
else:
to_caption[path.id] = (container_id, caption_id)
elif path.label == "to_footnote" and len(touched_elements) == 2:
# First element should be container, second should be footnote
container_id, footnote_id = touched_elements[0], touched_elements[1]
Expand All @@ -134,8 +141,15 @@ def map_path_points_to_elements(
f"Footnote path {path.id}: Backwards annotation detected, auto-correcting"
)
container_id, footnote_id = footnote_id, container_id
container_el, footnote_el = footnote_el, container_el

to_footnote[path.id] = (container_id, footnote_id)
if footnote_el and is_caption_element(footnote_el):
logger.debug(
f"Footnote path {path.id}: Target is caption, treating as to_caption"
)
to_caption[path.id] = (container_id, footnote_id)
else:
to_footnote[path.id] = (container_id, footnote_id)
elif path.label == "to_value":
if len(touched_elements) == 2:
# Simple case: exactly 2 elements
Expand Down
Loading