docling-project / docling-project/docling

Image Orientation Issues Lead to Incorrect Text Extraction and Irrelevant Output from Transformer Model

Open
#1,279 1 comment 0 reactions 0 assignees View on GitHub
bug smoldocling
Dominant language
Python
Stars
66.4k
Forks
4.8k
Avg merge
2d 21h
Merged PRs (30d)
84

Description

### Bug
If the image orientation is rotated, then everything breaks. If the image is not oriented to read text left to right, the text extraction is poor, and the transformer model keeps generating non-related text. I've attached an image to reproduce the issue. You can upload the image and convert the page to Docling [here](https://huggingface.co/spaces/ds4sd/SmolDocling-256M-Demo).

### Steps to reproduce
1. Upload the image to the Hugging Face demo: https://huggingface.co/spaces/ds4sd/SmolDocling-256M-Demo
2. Observe that if the image orientation is not correctly aligned (text is not left to right), the text extraction becomes inaccurate.
3. Notice that the transformer model generates irrelevant text after processing the rotated image.

### 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-311 (3.11.11)
Platform: macOS-15.3.2-arm64-arm-64bit

### Python version
Python 3.11.11

![Image](https://github.com/user-attachments/assets/3c438880-6512-4477-bca5-6b6ee93b2410)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.