Koshur Pixel
Koshur Pixel is a synthetic optical character recognition (OCR) dataset for Kashmiri (ks), in which Unicode text is rendered to images using Nastaliq / Naksh-style fonts and paired with its exact transcription. It is built for OCR recognition, image-to-text modeling, fine-tuning, and evaluation workflows that need clean, controllable image/label pairs at scale.
Because the text is rendered programmatically, every image ships with a perfectly aligned ground-truth label — making the dataset well suited for pretraining, curriculum learning, and isolating model behavior before introducing noisy real-world scans.
Sentences
Paragraphs
Pages
Dataset summary
| Property | Value |
|---|---|
| Language | Kashmiri (ks) |
| Script | Perso-Arabic (Nastaliq / Naksh) |
| Modality | Image → Text (OCR) |
| Source | Synthetic (font-rendered) |
| Fonts | Gulmarg Nastaleeq, Afan Koshur Naksh |
Total rows (full) |
613,078. |
| License | CC BY-ND 4.0 |
Configurations and sizes
The dataset is organized by render granularity. Each granularity is exposed as its own config, plus a full config that virtually concatenates all four.
| Config | Description | Rows |
|---|---|---|
mixed |
Mixed-granularity segments (word, sentence/line, paragraph, and page level) | 119,114 |
sentence_line |
Sentence / line-level renders | 378,534 |
paragraph |
Longer paragraph-level renders | 72,851 |
page |
Page-level renders | 42,679 |
full |
Concatenation of all four configs above | 613,078. |
Data fields
Every row shares the same schema across all configs:
| Field | Type | Description |
|---|---|---|
image |
Image |
Rendered OCR image |
text |
string |
Unicode text label (exact transcription) |
sample_type |
string |
One of mixed, sentence_line, paragraph, page |
font_family |
string |
Renderer font (Gulmarg Nastaleeq or Afan Koshur Naksh) |
source_run_id |
string |
Internal generation run identifier |
image_path |
string |
Source image path in the original generator volume |
width |
int |
Image width in pixels |
height |
int |
Image height in pixels |
text_chars |
int |
Label length in Unicode codepoints |
line_count |
int |
Number of lines in the label |
A per-row image path is also retained inside the image struct metadata for traceability. All configs use parquet row-group sizing with small groups and page-index metadata enabled for Dataset Viewer compatibility.
Usage
Install the dependency:
pip install datasets
Load a single config:
from datasets import load_dataset
train = load_dataset("Omarrran/Koshur_Pixel", "sentence_line", split="train") # you can also use "paragraph" or "page" instead of "sentences"
print(train.column_names)
print(train[0]["text"])
print(train[0]["image"].size)
Load the combined config:
from datasets import load_dataset
full = load_dataset("Omarrran/Koshur_Pixel", "full", split="train")
print(len(full)) # 280657
Stream a config (recommended for the larger paragraph / page renders):
from datasets import load_dataset
ds = load_dataset(
"Omarrran/Koshur_Pixel",
name="paragraph",
split="train",
streaming=True,
)
for sample in ds:
img = sample["image"]
txt = sample["text"]
# feed into OCR preprocessing / tokenizer pipeline
Inspect a row:
print(mixed[0]["text"], mixed[0]["font_family"], mixed[0]["sample_type"])
Loading each config
from datasets import load_dataset
mixed = load_dataset("Omarrran/Koshur_Pixel", "mixed", split="train")
sentence_line = load_dataset("Omarrran/Koshur_Pixel", "sentence_line", split="train")
paragraph = load_dataset("Omarrran/Koshur_Pixel", "paragraph", split="train")
page = load_dataset("Omarrran/Koshur_Pixel", "page", split="train")
full = load_dataset("Omarrran/Koshur_Pixel", "full", split="train")
Recommended use cases
- Fine-tuning image-to-text and OCR models such as TrOCR, Donut, BLIP-2, and PaliGemma-style decoders.
- Pretraining or curriculum stages before introducing noisy scanned or photographed OCR corpora.
- Evaluating normalization, decoding, and post-correction pipelines on Nastaliq scripts.
- Prompting and benchmarking Kashmiri text understanding under controlled synthetic conditions.
Limitations and considerations
- This is synthetic OCR data. Performance on font-rendered text does not guarantee performance on real scans, photographs, or handwriting — validate on in-domain data before any production deployment.
- Only two fonts are represented in this release (
Gulmarg Nastaleeq,Afan Koshur Naksh), so visual diversity is narrower than real-world print. - The
paragraphandpageconfigs contain long, multi-line labels and large images; always consume them through thedatasetslibrary rather than raw parsing.
License
Released under Creative Commons Attribution-NoDerivatives 4.0 International (CC BY-ND 4.0). You may copy and redistribute the dataset for any purpose with attribution, but you may not distribute modified versions.
Citation
If you use this dataset, please cite it as a synthetic Kashmiri OCR resource and include the exact Hugging Face revision/SHA used:
@misc{koshur_pixel,
title = {Koshur Pixel: A Synthetic OCR Dataset for Kashmiri},
author = {Malik, Haq Nawaz , Nahfid Nissar, Faizan Iqbal},
howpublished = {\url{https://arxiv.org/abs/2606.23144}},
note = {Synthetic Nastaliq/Naksh-rendered image–text pairs. Cite the exact revision/SHA used.},
year = {2026}
}
``
- Downloads last month
- 186














































