--- license: apache-2.0 language: - en - de tags: - object-detection - document-understanding - invoice - layout-analysis - bounding-box - ocr-prep task_categories: - object-detection size_categories: - n<1K pretty_name: Invoice Layout Annotated BBox Dataset dataset_info: features: - name: image dtype: image - name: image_id dtype: int64 - name: document_id dtype: int64 - name: document_filename dtype: string - name: page_number dtype: int64 - name: width dtype: int64 - name: height dtype: int64 - name: objects struct: - name: id list: int64 - name: area list: float64 - name: bbox list: list: float32 length: 4 - name: category list: class_label: names: '0': invoice_metadata '1': vendor_block '2': customer_block '3': table_block '4': line_item '5': summary_block '6': payment_block '7': Column splits: - name: train num_bytes: 40359783 num_examples: 76 download_size: 36093604 dataset_size: 40359783 configs: - config_name: default data_files: - split: train path: data/train-* --- 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. ## Dataset summary | Property | Value | |----------|-------| | **Pages** | 76 | | **Documents** | 1 | | **Source PDF** | `train_images.pdf` | | **Total annotations** | 771 | | **Avg boxes / page** | 10.14 | | **Image width range** | 425 – 2853 px | | **Image height range** | 570 – 4096 px | | **Export date** | 2026-06-22T19:27:38.375Z | | **Annotation tool** | AnnotateEverything | | **Project** | Invoices (id=2) | ## Classes | ID | Name | Description | Color | Count | |----|------|-------------|-------|-------| | 0 | `invoice_metadata` | Invoice number, date, header metadata | `#f59e0b` | 83 | | 1 | `vendor_block` | Seller / vendor address block | `#22c55e` | 73 | | 2 | `customer_block` | Client / customer address block | `#ef4444` | 74 | | 3 | `table_block` | Line items table region | `#ec4899` | 76 | | 4 | `line_item` | Individual line item row | `#8b5cf6` | 257 | | 5 | `summary_block` | Totals / summary section | `#3b82f6` | 78 | | 6 | `payment_block` | Payment / IBAN block | `#06b6d4` | 55 | | 7 | `Column` | Table column header row | `#64748b` | 75 | ## Dataset Viewer schema The `train` split uses COCO-style `objects` with `[x, y, width, height]` bboxes (top-left origin): | Column | Type | |--------|------| | `image` | Image | | `image_id`, `document_id`, `page_number`, `width`, `height` | int | | `document_filename` | string | | `objects.bbox` | list of `[x, y, w, h]` | | `objects.category` | ClassLabel (8 layout regions) | | `objects.area`, `objects.id` | float / int | ## Raw export layout The original AnnotateEverything export is preserved under `raw_export/`: ``` raw_export/ ├── manifest.json ├── annotations.json └── documents/.../pages/page_NNN/image.png ``` ## Sample pages ### Page 1 (8 boxes) | Original | Annotated | |----------|-----------| | ![page 1 original](samples/page_001_original.jpg) | ![page 1 annotated](samples/page_001_annotated.jpg) | ### Page 20 (13 boxes) | Original | Annotated | |----------|-----------| | ![page 20 original](samples/page_020_original.jpg) | ![page 20 annotated](samples/page_020_annotated.jpg) | ### Page 39 (10 boxes) | Original | Annotated | |----------|-----------| | ![page 39 original](samples/page_039_original.jpg) | ![page 39 annotated](samples/page_039_annotated.jpg) | ### Page 58 (4 boxes) | Original | Annotated | |----------|-----------| | ![page 58 original](samples/page_058_original.jpg) | ![page 58 annotated](samples/page_058_annotated.jpg) | ### Page 76 (8 boxes) | Original | Annotated | |----------|-----------| | ![page 76 original](samples/page_076_original.jpg) | ![page 76 annotated](samples/page_076_annotated.jpg) | ### Page 19 (14 boxes) | Original | Annotated | |----------|-----------| | ![page 19 original](samples/page_019_original.jpg) | ![page 19 annotated](samples/page_019_annotated.jpg) | ## Label distribution | Label | Count | |-------|-------| | `line_item` | 257 | | `invoice_metadata` | 83 | | `summary_block` | 78 | | `table_block` | 76 | | `Column` | 75 | | `customer_block (Receiver)` | 74 | | `vendor_block (Sender)` | 73 | | `payment_block` | 55 | ## Usage ### Load with Hugging Face Datasets (recommended) ```python from datasets import load_dataset ds = load_dataset("AvoCahDoe/invoice-annotated-bbox") example = ds["train"][0] print(example["objects"]) # COCO-style bboxes + categories example["image"].show() ``` ### Load raw AnnotateEverything export ```python import json from huggingface_hub import hf_hub_download ann_path = hf_hub_download("AvoCahDoe/invoice-annotated-bbox", "raw_export/annotations.json", repo_type="dataset") with open(ann_path) as f: pages = json.load(f) ``` ### Convert to YOLO (invoice-extractor) ```bash python scripts/prepare_annotated_dataset.py ``` ## License Apache 2.0