docling-project / docling-project/docling
Setting settings.debug.visualize_cells=True/False causes different table output
- Dominant language
- Python
- Stars
- 66.4k
- Forks
- 4.8k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 84
Description
### Bug
I have pre-ocr pdf with following layout.
```
Logo Page Header
Key-value Items Figure
Section Header1
Table1
Section Header2
Table2
```
1. settings.debug.visualize_cells=False, only Table2 is detected.
2. settings.debug.visualize_cells=True, Table1 and Table2 are detected and merged to one table.
Both outcomes are wrong .
Second case can be solved by modifying file docling/models/page_preprocessing_model.py
before:
```
if settings.debug.visualize_cells:
draw_text_boxes(page.get_image(scale=1.0), page.cells)
```
after:
```
if settings.debug.visualize_cells:
draw_text_boxes(page.get_image(scale=1.0).copy(), page.cells)
```
...
### Steps to reproduce
Play with settings.debug.visualize_cells
...
### Docling version
Docling version: 2.28.4
Docling Core version: 2.25.0
Docling IBM Models version: 3.4.1
Docling Parse version: 4.0.0
Python: cpython-310 (3.10.15)
Platform: Linux-5.15.167.4-microsoft-standard-WSL2-x86_64-with-glibc2.35
...
### Python version
Python 3.10.15
...
Contributor guide
Assessment
This issue has not been assessed yet.