Datasets:
Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
tags:
|
| 6 |
+
- table-structure-recognition
|
| 7 |
+
- table-detection
|
| 8 |
+
- ocr
|
| 9 |
+
- document-ai
|
| 10 |
+
- icdar
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
# ICDAR-2013-Logical: A Line-Level Logical Conversion of the ICDAR 2013 Table Dataset
|
| 14 |
+
|
| 15 |
+
## Dataset Description
|
| 16 |
+
|
| 17 |
+
This dataset is a converted and enhanced version of the **ICDAR 2013 Table Competition dataset**, specifically reformatted for modern **Table Structure Recognition (TSR)** and **OCR** tasks. 📜
|
| 18 |
+
|
| 19 |
+
The primary contribution of this version is the creation of a direct link between low-level OCR output and the table's logical structure. For each table, the dataset provides:
|
| 20 |
+
1. A high-resolution **cropped PNG image** of the table region (rendered at 144 DPI).
|
| 21 |
+
2. A detailed **JSON file** that maps each detected text line's physical bounding box to its logical grid coordinates (`[row_start, row_end, col_start, col_end]`).
|
| 22 |
+
|
| 23 |
+
This format is ideal for training and evaluating Document AI models that perform OCR and table understanding concurrently.
|
| 24 |
+
|
| 25 |
+
---
|
| 26 |
+
|
| 27 |
+
## How to Use
|
| 28 |
+
|
| 29 |
+
You can load an example by pairing the images from the `cropped_images` directory with the JSON annotations in `logical_gt`.
|
| 30 |
+
|
| 31 |
+
```python
|
| 32 |
+
import json
|
| 33 |
+
from PIL import Image
|
| 34 |
+
from pathlib import Path
|
| 35 |
+
|
| 36 |
+
# Assume dataset is loaded or cloned locally
|
| 37 |
+
base_path = Path("./") # Path to the dataset directory
|
| 38 |
+
|
| 39 |
+
# Get a list of all examples
|
| 40 |
+
gt_files = list((base_path / "logical_gt").glob("*.json"))
|
| 41 |
+
example_file = gt_files[0]
|
| 42 |
+
|
| 43 |
+
# Load the annotation data
|
| 44 |
+
with open(example_file, 'r') as f:
|
| 45 |
+
annotations = json.load(f)
|
| 46 |
+
|
| 47 |
+
# Load the corresponding image
|
| 48 |
+
image_path = base_path / "cropped_images" / (example_file.stem + ".png")
|
| 49 |
+
image = Image.open(image_path)
|
| 50 |
+
|
| 51 |
+
# Display the first annotation for the first line of text
|
| 52 |
+
first_line = annotations[0]
|
| 53 |
+
print(f"Text: {first_line['text']}")
|
| 54 |
+
print(f"Bounding Box: {first_line['box']}")
|
| 55 |
+
print(f"Logical Coordinates: {first_line['logical_coords']}")
|
| 56 |
+
|
| 57 |
+
# image.show()
|