ocr-region-1024-v1
收藏资源简介:
# OCR-Region 1024 v1 ## Overview OCR-Region 1024 v1 is a line-level OCR-with-region training dataset for vision language models. Each sample combines: - **Image**: JPEG at 1024px longest side (quality 92) - **OCR Annotations**: Line-level text with bounding boxes, plus optional word-level boxes - **Provenance Metadata**: Source origin, original dimensions, and scale factor The dataset is stored as [webdataset](https://github.com/webdataset/webdataset) tar shards, enabling efficient streaming at scale. Each record contains axis-aligned bounding boxes as integer pixel coordinates in the 1024px resized space, with optional polygon vertices for skewed text. ### Data Format ```json { "__key__": "idl/shard0007/doc123_p4", "image": "<jpeg bytes, longest side = 1024, quality 92>", "meta": { "source": "idl-wds", "orig_size": [width, height], "scale": 0.53 }, "lines": [ { "text": "TOTAL AMOUNT DUE", "bbox": [x0, y0, x1, y1], "conf": 0.991, "poly": [[x0, y0], [x1, y0], [x1, y1], [x0, y1]] } ], "words": [ { "text": "TOTAL", "bbox": [x0, y0, x1, y1], "line_idx": 0 } ] } ``` **Coordinate Convention**: All bbox coordinates are integer pixels in the 1024px resized image space. Format is `[x0, y0, x1, y1]` with `x0 < x1` and `y0 < y1`. Polygons are optional and preserve original skew information from source annotations. ## Dataset Layout ``` dataset/ ├── train/ │ ├── idl/<n>/ │ │ ├── shard0000.tar │ │ ├── shard0001.tar │ │ └── manifest.jsonl │ ├── doclaynet/ │ │ ├── *.tar │ │ └── manifest.jsonl │ ├── hiertext/ │ │ ├── *.tar │ │ └── manifest.jsonl │ └── textocr/ │ ├── *.tar │ └── manifest.jsonl └── val/ ├── idl/ │ ├── *.tar │ └── manifest.jsonl ├── doclaynet/ │ ├── *.tar │ └── manifest.jsonl ├── hiertext/ │ ├── *.tar │ └── manifest.jsonl └── textocr/ ├── *.tar └── manifest.jsonl ``` Each directory contains one `manifest.jsonl` file with per-shard metadata: record counts, drop statistics, and processing timestamps. ## Sources and Licensing | Source | License | Volume | Annotations | Notes | |--------|---------|--------|-------------|-------| | **pixparse/idl-wds** | Custom IDL-Train | ~450K pages | Line text + bbox + confidence score | Industry Documents Library via AWS. Textract-extracted coordinates. Confidence threshold >= 90%. **ATTRIBUTION**: This dataset repo is private; custom license requires explicit licensing agreement. See original [IDL documentation](https://opendata.s3.amazonaws.com/IDL/IDL-Homepage.html). | | **HierText (Official)** | CC BY-SA 4.0 | 8,281 train images | Word/line/paragraph polygons | Gold-standard semantic hierarchy. Images sourced from Open Images via CVDF. **ATTRIBUTION REQUIRED**: Per CC BY-SA 4.0, derivative works must credit original. Images retain Open Images attribution. Share-alike clause applies. | | **ds4sd/DocLayNet-v1.1** | CDLA-Permissive-1.0 | ~50K train pages | Cell text + bbox; lines reconstructed | PDF-derived layout cells. Line-level annotations reconstructed via y-overlap clustering. Permissive commercial use. | | **TextOCR (Official)** | CC BY 4.0 | 21,778 train images | Word quadrilaterals only | Meta-sponsored OCR dataset on scene images. Word-level polygons converted to axis-aligned boxes. **Attribution**: Credit Meta (Facebook). No share-alike restriction. | ## Data Cleaning and Filtering All records undergo aggressive quality gates applied during conversion: ### Global (applies to every record after resize to 1024px) 1. **Bbox Validation**: Every bounding box is clamped to image bounds and validated: `x1 > x0 + 2` and `y1 > y0 + 2` (minimum 3-pixel extent). Records exceeding 10% invalid boxes are discarded entirely. 2. **Text Filtering**: Empty or whitespace-only text entries are dropped. 3. **Minimum Content**: Records must contain ≥5 lines (for line-level sources) or ≥5 words (for word-level sources) to be kept. 4. **Deduplication**: Exact page duplicates within a source are identified via SHA1 of sorted line texts and dropped. 5. **Provenance Tracking**: Every record carries source, shard ID, and original key for later excision if needed. ### Per-Source - **idl-wds**: Textract confidence >= 90%. Pages where > 30% of lines fall below threshold are dropped (bad scans). - **DocLayNet**: Pseudo-tokens and zero-height boxes discarded. Reconstructed lines with > 40% mutual token overlap are dropped. - **HierText**: Illegible words (`legible == false`) dropped. Vertical text (`vertical == true`) skipped. Placeholder `.` transcriptions removed. Handwritten flag preserved in metadata. - **TextOCR**: Illegible (`.`) word annotations dropped. **Build Date**: 2026-07-04 **Acceptance Criterion**: Drop rate < 25% per source; zero invalid boxes in pilot verification. ## Intended Use OCR-Region 1024 v1 is designed for: - **Grounding Supervision**: Training vision-language models to bind text predictions to spatial regions (line-level bounding box regression). - **Region-to-Text Tasks**: "Read the text in region [bbox]" or "locate line X in the image." - **Document Understanding**: Fine-grained layout comprehension on real documents and scene images. ### Not Suitable For - This dataset is **not a hallucination cure**. It provides spatial alignment supervision but does not guarantee factual correctness of OCR transcriptions (particularly for rare scripts or degraded images). - General text-only OCR training (use [TextOCR](https://www.microsoft.com/en-us/research/publication/textocr/) or [Scene Text Recognition Benchmarks](https://github.com/Canjie-Luo/Scene-Text-Recognition) instead). ## Statistics | Split | idl-wds | DocLayNet | HierText | TextOCR | Total | |-------|---------|-----------|----------|---------|-------| | Train | ~450K | ~50K | 8,281 | 21,778 | ~530K | | Val | 2K | ~5K | 1,724 | 3,124 | ~11.8K | Training sampling weights: idl-wds 0.55 / doclaynet 0.25 / hiertext 0.12 / textocr 0.08 (HierText upweighted for hierarchy quality). ## Access and Citation This dataset is **private**. Access requires permission from the repository owner. If you use OCR-Region 1024 v1 in research, please: 1. Cite the [IDL documentation](https://opendata.s3.amazonaws.com/IDL/IDL-Homepage.html) for pixparse/idl-wds samples 2. Cite [HierText](https://github.com/google-research-datasets/hiertext) for HierText samples with proper CC BY-SA 4.0 attribution 3. Cite [DocLayNet](https://huggingface.co/datasets/ds4sd/DocLayNet-v1.1) for document layout samples 4. Cite [TextOCR](https://arxiv.org/abs/2003.06571) for scene text samples with Meta attribution ## Known Limitations - **Coordinate Convention**: Bboxes are axis-aligned (AABB), even for skewed text. Raw polygon vertices are preserved in `poly` fields where available. - **Language**: Primarily English (IDL US documents, Open Images, TextOCR). Some multilingual content from HierText. - **Quality Variance**: Textract confidence scores (idl-wds) range 0.90–1.0; other sources lack per-box confidence. - **Scene vs. Document Split**: Mixed; no explicit scene/document split in train. Validation splits isolate sources for source-specific evaluation. ## Dataset Versioning **Version**: 1.0 **Built**: 2026-07-04 **Freeze Hash**: [revision tagged by training config] --- *Generated for vision-language model training with attribution to all upstream sources.*



