docling-project / docling-project/docling

"Multi-format conversion" documentation example doesn't OCR the PNG file

Open
#1,083 1 comment 0 reactions 0 assignees View on GitHub
question triage/close-stale
Dominant language
Python
Stars
66.4k
Forks
4.8k
Avg merge
2d 21h
Merged PRs (30d)
84

Description

### Question
I'm incorporating docling into my code base but the OCR for PNG files with text isn't producing good results.

If I run the Docling [Multi-format conversion documentation example](https://ds4sd.github.io/docling/examples/run_with_formats/) code with the png file, `tests/data/2305.03393v1-pg9-img.png`, it creates the Markdown, JSON, and YAML files but they don't have the text shown in the image.

Is this to be expected?

[Here's the image](https://raw.githubusercontent.com/DS4SD/docling/refs/heads/main/tests/data/2305.03393v1-pg9-img.png)

Markdown output file **is empty**.

JSON output file contains a snippet (I've bolded it) but nothing else:
```
{
"schema_name": "DoclingDocument",
"version": "1.1.0",
"name": "2305.03393v1-pg9-img",
"origin": {
"mimetype": "application/pdf",
"binary_hash": 17975927720389090741,
"filename": "2305.03393v1-pg9-img.png"
},
"furniture": {
"self_ref": "#/furniture",
"children": [],
"content_layer": "furniture",
"name": "_root_",
"label": "unspecified"
},
"body": {
"self_ref": "#/body",
"children": [
{
"$ref": "#/texts/0"
},
{
"$ref": "#/tables/0"
}
],
"content_layer": "body",
"name": "_root_",
"label": "unspecified"
},
"groups": [],
"texts": [
{
"self_ref": "#/texts/0",
"parent": {
"$ref": "#/body"
},
"children": [],
"content_layer": "furniture",
"label": "page_header",
"prov": [
{
"page_no": 1,
"bbox": {
"l": 402.3333333333333,
"t": 1459.0,
"r": 933.6666666666666,
"b": 1433.0,
"coord_origin": "BOTTOMLEFT"
},
"charspan": [
0,
60
]
}
],
"orig": "**Optimized Table Tokenization for Table Structure Recognition**",
"text": "**Optimized Table Tokenization for Table Structure Recognition**"
}
],
"pictures": [],
"tables": [
{
"self_ref": "#/tables/0",
"parent": {
"$ref": "#/body"
},
"children": [],
"content_layer": "body",
"label": "table",
"prov": [
{
"page_no": 1,
"bbox": {
"l": 291.4955139160156,
"t": 945.98876953125,
"r": 989.3460083007812,
"b": 672.041748046875,
"coord_origin": "BOTTOMLEFT"
},
"charspan": [
0,
0
]
}
],
"captions": [],
"references": [],
"footnotes": [],
"data": {
"table_cells": [],
"num_rows": 0,
"num_cols": 0,
"grid": []
}
}
],
"key_value_items": [],
"form_items": [],
"pages": {
"1": {
"size": {
"width": 1275.0,
"height": 1650.0
},
"page_no": 1
}
}
}
```

YAML file:
```
body:
children:
- $ref: '#/texts/0'
- $ref: '#/tables/0'
content_layer: body
label: unspecified
name: _root_
self_ref: '#/body'
form_items: []
furniture:
children: []
content_layer: furniture
label: unspecified
name: _root_
self_ref: '#/furniture'
groups: []
key_value_items: []
name: 2305.03393v1-pg9-img
origin:
binary_hash: 17975927720389090741
filename: 2305.03393v1-pg9-img.png
mimetype: application/pdf
pages:
'1':
page_no: 1
size:
height: 1650.0
width: 1275.0
pictures: []
schema_name: DoclingDocument
tables:
- captions: []
children: []
content_layer: body
data:
grid: []
num_cols: 0
num_rows: 0
table_cells: []
footnotes: []
label: table
parent:
$ref: '#/body'
prov:
- bbox:
b: 672.041748046875
coord_origin: BOTTOMLEFT
l: 291.4955139160156
r: 989.3460083007812
t: 945.98876953125
charspan:
- 0
- 0
page_no: 1
references: []
self_ref: '#/tables/0'
texts:
- children: []
content_layer: furniture
label: page_header
orig: Optimized Table Tokenization for Table Structure Recognition
parent:
$ref: '#/body'
prov:
- bbox:
b: 1433.0
coord_origin: BOTTOMLEFT
l: 402.3333333333333
r: 933.6666666666666
t: 1459.0
charspan:
- 0
- 60
page_no: 1
self_ref: '#/texts/0'
text: Optimized Table Tokenization for Table Structure Recognition
version: 1.1.0
```

## Versions
docling = 2.24.0
docling-core = 2.20.0
docling-ibm-models = 3.4.0
docling-parse = 3.4.0
python = 3.9.21

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.