STR / README.md
Mohaddz's picture
Publish verified Arabic scene-text dataset for TextSSR
845ab11 verified
|
Raw History Blame Contribute Delete
5.71 kB
metadata
language:
  - ar
task_categories:
  - image-to-text
pretty_name: Arabic Scene Text — Real Data for TextSSR
license: other
license_name: mixed-source-terms
license_link: https://huggingface.co/datasets/Mohaddz/STR#source-terms
tags:
  - ocr
  - arabic
  - scene-text
  - textssr
  - real-images
configs:
  - config_name: scene_context
    default: true
    data_files:
      - split: test
        path: data/scene_context/test-*.parquet
      - split: train
        path: data/scene_context/train-*.parquet
      - split: validation
        path: data/scene_context/validation-*.parquet

Arabic Scene Text — Real Data for TextSSR

A provenance-preserving collection of real Arabic scene-word examples. Each viewer row starts with a word crop and its original source transcription. The scene_context configuration also includes a surrounding scene patch, a word mask, and a joined right-to-left Arabic glyph image. Every retained example in this release has recoverable scene context.

This release contains 14,336 retained word examples after structural checks and exact crop deduplication. Source photographs and word crops are real; masks and glyphs are generated conditioning assets. There is no target-count cap.

Preview

Word crops, scene context, and Arabic glyph conditioning

Configurations and splits

from datasets import load_dataset
data = load_dataset("Mohaddz/STR", "scene_context")
print(data["train"][0]["image"], data["train"][0]["text"])

train, validation, and test are grouped by original photograph and conservative duplicate groups. Existing official test labels are never moved into training; an overlapping test group wins over a training label. A reproducible 10% of official training groups is reserved for validation; otherwise unassigned groups use 80/10/10. Exact decoded images, conservative near-identical scenes, and exact crop duplicates cannot cross splits. This does not prove absence from the upstream training data of pretrained TextSSR or Nuqta checkpoints. Unknown-parent cropped-only examples remain in training/reference unless already officially held out; no photograph-disjoint validation/test claim is made for those crops.

TextSSR usage

textssr_lmdb/{train,validation,test}/data.mdb uses the authors' actual LMDB schema: image-000000001 stores the original scene image and annotations-000000001 stores a JSON list with polygon, text, and language. Only scene-context samples with 1–25 codepoints and no detected encoding/annotation conflict are included. Longer examples remain in the HF collection with textssr_compatible=false; their labels are never truncated.

The dataset format is compatible with the original AnyWordLmdbDataset. Its stock Alibaba-font rendering code still needs an Arabic-capable font and correct RTL shaping. The included textssr_dataset_adapter.py instead reads the ready-made context/mask/glyph columns and creates the character-conditioning tensor. It emits the upstream image, mask, masked_image, ttf_img, glyph, and text keys. It does not run or train a generator.

Conditioning: context images are 256×256; photographs use [-1,1], glyphs [0,1]. A mask value of 255 preserves the context and 0 identifies the editable word (3×3 dilation of editable region). Whole-word glyphs are shaped with Pillow/RAQM and DejaVu Sans. Perspective-rectified word crops are kept at source-derived size. Tiny/blurry samples are not silently rejected for being difficult.

Nuqta checks and review status

Nuqta model: SalahALHaismawi/Nuqta-Arabic-OCR-0.8B. It transcribes the crop without seeing the target annotation. nuqta_exact_match and nuqta_cer compare conservative NFC + outer-whitespace-normalized strings; the original text is unchanged. Hamza, dots, tatweel, diacritics, and distinct Arabic letters are not conflated. OCR disagreement is a review flag, not automatic grounds for changing labels or discarding a difficult example. human_reviewed=false explicitly means no human verification is claimed. An OCR agreement is not a proof that the label is correct.

Statuses: ocr_agreement, needs_review, ocr_error, generation_truncated, not_scored, or annotation_conflict. See reports/review_queue.jsonl and reports/export.json for detailed counts. The LMDB contains eligible source annotations, including OCR disagreements; consumers can filter the HF data explicitly if they need a narrower subset.

Source terms

This compilation does not relicense the original data. Source terms, attribution, and possible redistribution restrictions remain applicable. A code-repository license is not assumed to cover all source photographs. Any unverified rights are recorded for review before public upload.

Source Retained word rows Reported terms/status
evarest 5,337 Author repository: BSD-3-Clause; underlying photograph rights may vary
iiit_arabic 1,485 Public academic release; no explicit redistribution license located
kstrv2 2,981 CC BY 4.0 in the versioned Zenodo release
mlt2019 4,533 Original RRC-MLT terms apply; mirror licensing does not settle photograph rights

Official source links:

Audit artifacts

reports/ preserves acquisition outcomes, exclusions with reasons, split conflict decisions, source counts, character/length coverage, and Nuqta review outcomes. No new model was trained.