Datasets:
Update README with viewer schema and raw_export paths
Browse files
README.md
CHANGED
|
@@ -1,216 +1,202 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: apache-2.0
|
| 3 |
-
language:
|
| 4 |
-
- en
|
| 5 |
-
- de
|
| 6 |
-
tags:
|
| 7 |
-
- object-detection
|
| 8 |
-
- document-understanding
|
| 9 |
-
- invoice
|
| 10 |
-
- layout-analysis
|
| 11 |
-
- bounding-box
|
| 12 |
-
- ocr-prep
|
| 13 |
-
task_categories:
|
| 14 |
-
- object-detection
|
| 15 |
-
size_categories:
|
| 16 |
-
- n<1K
|
| 17 |
-
pretty_name: Invoice Layout Annotated BBox Dataset
|
| 18 |
-
dataset_info:
|
| 19 |
-
features:
|
| 20 |
-
- name: image
|
| 21 |
-
dtype: image
|
| 22 |
-
- name: image_id
|
| 23 |
-
dtype: int64
|
| 24 |
-
- name: document_id
|
| 25 |
-
dtype: int64
|
| 26 |
-
- name: document_filename
|
| 27 |
-
dtype: string
|
| 28 |
-
- name: page_number
|
| 29 |
-
dtype: int64
|
| 30 |
-
- name: width
|
| 31 |
-
dtype: int64
|
| 32 |
-
- name: height
|
| 33 |
-
dtype: int64
|
| 34 |
-
- name: objects
|
| 35 |
-
struct:
|
| 36 |
-
- name: id
|
| 37 |
-
list: int64
|
| 38 |
-
- name: area
|
| 39 |
-
list: float64
|
| 40 |
-
- name: bbox
|
| 41 |
-
list:
|
| 42 |
-
list: float32
|
| 43 |
-
length: 4
|
| 44 |
-
- name: category
|
| 45 |
-
list:
|
| 46 |
-
class_label:
|
| 47 |
-
names:
|
| 48 |
-
'0': invoice_metadata
|
| 49 |
-
'1': vendor_block
|
| 50 |
-
'2': customer_block
|
| 51 |
-
'3': table_block
|
| 52 |
-
'4': line_item
|
| 53 |
-
'5': summary_block
|
| 54 |
-
'6': payment_block
|
| 55 |
-
'7': Column
|
| 56 |
-
splits:
|
| 57 |
-
- name: train
|
| 58 |
-
num_bytes: 40359783
|
| 59 |
-
num_examples: 76
|
| 60 |
-
download_size: 36093604
|
| 61 |
-
dataset_size: 40359783
|
| 62 |
-
configs:
|
| 63 |
-
- config_name: default
|
| 64 |
-
data_files:
|
| 65 |
-
- split: train
|
| 66 |
-
path: data/train-*
|
| 67 |
-
---
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
|
| 76 |
-
|
|
| 77 |
-
| **
|
| 78 |
-
| **
|
| 79 |
-
| **
|
| 80 |
-
| **
|
| 81 |
-
| **
|
| 82 |
-
| **Image
|
| 83 |
-
| **
|
| 84 |
-
| **
|
| 85 |
-
| **
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
|
| 92 |
-
|
|
| 93 |
-
|
|
| 94 |
-
|
|
| 95 |
-
|
|
| 96 |
-
|
|
| 97 |
-
|
|
| 98 |
-
|
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
```
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
|
| 149 |
-
|
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
|
| 154 |
-
|
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
|
| 163 |
-
|
|
| 164 |
-
|
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
|
| 168 |
-
|
|
| 169 |
-
|
| 170 |
-
##
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
This dataset is the raw export consumed by `prepare_annotated_dataset.py` in the invoice-extractor training pipeline.
|
| 205 |
-
|
| 206 |
-
```bash
|
| 207 |
-
python scripts/prepare_annotated_dataset.py
|
| 208 |
-
```
|
| 209 |
-
|
| 210 |
-
## Citation
|
| 211 |
-
|
| 212 |
-
If you use this dataset, please cite the upstream annotation project and note the export format (AnnotateEverything bbox export v1).
|
| 213 |
-
|
| 214 |
-
## License
|
| 215 |
-
|
| 216 |
-
Apache 2.0
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
- de
|
| 6 |
+
tags:
|
| 7 |
+
- object-detection
|
| 8 |
+
- document-understanding
|
| 9 |
+
- invoice
|
| 10 |
+
- layout-analysis
|
| 11 |
+
- bounding-box
|
| 12 |
+
- ocr-prep
|
| 13 |
+
task_categories:
|
| 14 |
+
- object-detection
|
| 15 |
+
size_categories:
|
| 16 |
+
- n<1K
|
| 17 |
+
pretty_name: Invoice Layout Annotated BBox Dataset
|
| 18 |
+
dataset_info:
|
| 19 |
+
features:
|
| 20 |
+
- name: image
|
| 21 |
+
dtype: image
|
| 22 |
+
- name: image_id
|
| 23 |
+
dtype: int64
|
| 24 |
+
- name: document_id
|
| 25 |
+
dtype: int64
|
| 26 |
+
- name: document_filename
|
| 27 |
+
dtype: string
|
| 28 |
+
- name: page_number
|
| 29 |
+
dtype: int64
|
| 30 |
+
- name: width
|
| 31 |
+
dtype: int64
|
| 32 |
+
- name: height
|
| 33 |
+
dtype: int64
|
| 34 |
+
- name: objects
|
| 35 |
+
struct:
|
| 36 |
+
- name: id
|
| 37 |
+
list: int64
|
| 38 |
+
- name: area
|
| 39 |
+
list: float64
|
| 40 |
+
- name: bbox
|
| 41 |
+
list:
|
| 42 |
+
list: float32
|
| 43 |
+
length: 4
|
| 44 |
+
- name: category
|
| 45 |
+
list:
|
| 46 |
+
class_label:
|
| 47 |
+
names:
|
| 48 |
+
'0': invoice_metadata
|
| 49 |
+
'1': vendor_block
|
| 50 |
+
'2': customer_block
|
| 51 |
+
'3': table_block
|
| 52 |
+
'4': line_item
|
| 53 |
+
'5': summary_block
|
| 54 |
+
'6': payment_block
|
| 55 |
+
'7': Column
|
| 56 |
+
splits:
|
| 57 |
+
- name: train
|
| 58 |
+
num_bytes: 40359783
|
| 59 |
+
num_examples: 76
|
| 60 |
+
download_size: 36093604
|
| 61 |
+
dataset_size: 40359783
|
| 62 |
+
configs:
|
| 63 |
+
- config_name: default
|
| 64 |
+
data_files:
|
| 65 |
+
- split: train
|
| 66 |
+
path: data/train-*
|
| 67 |
+
---
|
| 68 |
+
|
| 69 |
+
|
| 70 |
+
Manually annotated invoice page images exported from **AnnotateEverything**, with axis-aligned bounding boxes for **8 document-layout regions**. Built for training object detectors (YOLO, DETR, etc.) on invoice macro-structure.
|
| 71 |
+
|
| 72 |
+
## Dataset summary
|
| 73 |
+
|
| 74 |
+
| Property | Value |
|
| 75 |
+
|----------|-------|
|
| 76 |
+
| **Pages** | 76 |
|
| 77 |
+
| **Documents** | 1 |
|
| 78 |
+
| **Source PDF** | `train_images.pdf` |
|
| 79 |
+
| **Total annotations** | 771 |
|
| 80 |
+
| **Avg boxes / page** | 10.14 |
|
| 81 |
+
| **Image width range** | 425 – 2853 px |
|
| 82 |
+
| **Image height range** | 570 – 4096 px |
|
| 83 |
+
| **Export date** | 2026-06-22T19:27:38.375Z |
|
| 84 |
+
| **Annotation tool** | AnnotateEverything |
|
| 85 |
+
| **Project** | Invoices (id=2) |
|
| 86 |
+
|
| 87 |
+
## Classes
|
| 88 |
+
|
| 89 |
+
| ID | Name | Description | Color | Count |
|
| 90 |
+
|----|------|-------------|-------|-------|
|
| 91 |
+
| 0 | `invoice_metadata` | Invoice number, date, header metadata | `#f59e0b` | 83 |
|
| 92 |
+
| 1 | `vendor_block` | Seller / vendor address block | `#22c55e` | 73 |
|
| 93 |
+
| 2 | `customer_block` | Client / customer address block | `#ef4444` | 74 |
|
| 94 |
+
| 3 | `table_block` | Line items table region | `#ec4899` | 76 |
|
| 95 |
+
| 4 | `line_item` | Individual line item row | `#8b5cf6` | 257 |
|
| 96 |
+
| 5 | `summary_block` | Totals / summary section | `#3b82f6` | 78 |
|
| 97 |
+
| 6 | `payment_block` | Payment / IBAN block | `#06b6d4` | 55 |
|
| 98 |
+
| 7 | `Column` | Table column header row | `#64748b` | 75 |
|
| 99 |
+
|
| 100 |
+
## Dataset Viewer schema
|
| 101 |
+
|
| 102 |
+
The `train` split uses COCO-style `objects` with `[x, y, width, height]` bboxes (top-left origin):
|
| 103 |
+
|
| 104 |
+
| Column | Type |
|
| 105 |
+
|--------|------|
|
| 106 |
+
| `image` | Image |
|
| 107 |
+
| `image_id`, `document_id`, `page_number`, `width`, `height` | int |
|
| 108 |
+
| `document_filename` | string |
|
| 109 |
+
| `objects.bbox` | list of `[x, y, w, h]` |
|
| 110 |
+
| `objects.category` | ClassLabel (8 layout regions) |
|
| 111 |
+
| `objects.area`, `objects.id` | float / int |
|
| 112 |
+
|
| 113 |
+
## Raw export layout
|
| 114 |
+
|
| 115 |
+
The original AnnotateEverything export is preserved under `raw_export/`:
|
| 116 |
+
|
| 117 |
+
```
|
| 118 |
+
raw_export/
|
| 119 |
+
├── manifest.json
|
| 120 |
+
├── annotations.json
|
| 121 |
+
└── documents/.../pages/page_NNN/image.png
|
| 122 |
+
```
|
| 123 |
+
|
| 124 |
+
## Sample pages
|
| 125 |
+
|
| 126 |
+
### Page 1 (8 boxes)
|
| 127 |
+
|
| 128 |
+
| Original | Annotated |
|
| 129 |
+
|----------|-----------|
|
| 130 |
+
|  |  |
|
| 131 |
+
### Page 20 (13 boxes)
|
| 132 |
+
|
| 133 |
+
| Original | Annotated |
|
| 134 |
+
|----------|-----------|
|
| 135 |
+
|  |  |
|
| 136 |
+
### Page 39 (10 boxes)
|
| 137 |
+
|
| 138 |
+
| Original | Annotated |
|
| 139 |
+
|----------|-----------|
|
| 140 |
+
|  |  |
|
| 141 |
+
### Page 58 (4 boxes)
|
| 142 |
+
|
| 143 |
+
| Original | Annotated |
|
| 144 |
+
|----------|-----------|
|
| 145 |
+
|  |  |
|
| 146 |
+
### Page 76 (8 boxes)
|
| 147 |
+
|
| 148 |
+
| Original | Annotated |
|
| 149 |
+
|----------|-----------|
|
| 150 |
+
|  |  |
|
| 151 |
+
### Page 19 (14 boxes)
|
| 152 |
+
|
| 153 |
+
| Original | Annotated |
|
| 154 |
+
|----------|-----------|
|
| 155 |
+
|  |  |
|
| 156 |
+
|
| 157 |
+
## Label distribution
|
| 158 |
+
|
| 159 |
+
| Label | Count |
|
| 160 |
+
|-------|-------|
|
| 161 |
+
| `line_item` | 257 |
|
| 162 |
+
| `invoice_metadata` | 83 |
|
| 163 |
+
| `summary_block` | 78 |
|
| 164 |
+
| `table_block` | 76 |
|
| 165 |
+
| `Column` | 75 |
|
| 166 |
+
| `customer_block (Receiver)` | 74 |
|
| 167 |
+
| `vendor_block (Sender)` | 73 |
|
| 168 |
+
| `payment_block` | 55 |
|
| 169 |
+
|
| 170 |
+
## Usage
|
| 171 |
+
|
| 172 |
+
### Load with Hugging Face Datasets (recommended)
|
| 173 |
+
|
| 174 |
+
```python
|
| 175 |
+
from datasets import load_dataset
|
| 176 |
+
|
| 177 |
+
ds = load_dataset("AvoCahDoe/invoice-annotated-bbox")
|
| 178 |
+
example = ds["train"][0]
|
| 179 |
+
print(example["objects"]) # COCO-style bboxes + categories
|
| 180 |
+
example["image"].show()
|
| 181 |
+
```
|
| 182 |
+
|
| 183 |
+
### Load raw AnnotateEverything export
|
| 184 |
+
|
| 185 |
+
```python
|
| 186 |
+
import json
|
| 187 |
+
from huggingface_hub import hf_hub_download
|
| 188 |
+
|
| 189 |
+
ann_path = hf_hub_download("AvoCahDoe/invoice-annotated-bbox", "raw_export/annotations.json", repo_type="dataset")
|
| 190 |
+
with open(ann_path) as f:
|
| 191 |
+
pages = json.load(f)
|
| 192 |
+
```
|
| 193 |
+
|
| 194 |
+
### Convert to YOLO (invoice-extractor)
|
| 195 |
+
|
| 196 |
+
```bash
|
| 197 |
+
python scripts/prepare_annotated_dataset.py
|
| 198 |
+
```
|
| 199 |
+
|
| 200 |
+
## License
|
| 201 |
+
|
| 202 |
+
Apache 2.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|