CoolFace
Datasetpublic

himalaya-ai/devanagari_ocr_graphemes

Devanagari OCR Grapheme Dataset This repository hosts a grapheme‑level OCR dataset for the Devanagari script. Each data point consists of an image of a single grapheme and its corresponding Unicode text. Dataset Structure . ├── data/ # Directory containing all PNG images (e.g., 00000.png, 00001.png, ...) ├── devanagari_ocr_graphemes.json # ShareGPT‑formatted JSON file └── README.md # This file data/ – Images are stored in… See the full description on the dataset page: https://huggingface.co/datasets/himalaya-ai/devanagari_ocr_graphemes.

sourceHugging Facemitupdated 4mo agoView on Hugging Face
1likes27downloads
Dataset Card

Devanagari OCR Grapheme Dataset

This repository hosts a grapheme‑level OCR dataset for the Devanagari script. Each data point consists of an image of a single grapheme and its corresponding Unicode text.


Dataset Structure

.
├── data/                     # Directory containing all PNG images (e.g., 00000.png, 00001.png, ...)
├── devanagari_ocr_graphemes.json   # ShareGPT‑formatted JSON file
└── README.md                 # This file
  • `data/` – Images are stored in PNG format. The file name (e.g., 00000.png) uniquely identifies each grapheme.
  • `devanagari_ocr_graphemes.json` – The dataset is provided in the ShareGPT format required by LLaMA‑Factory for multimodal supervised fine‑tuning.

ShareGPT Format

Each entry in devanagari_ocr_graphemes.json follows this schema:

json
[
  {
    "messages": [
      {
        "role": "user",
        "content": "<image>OCR:"
      },
      {
        "role": "assistant",
        "content": "<grapheme text>"
      }
    ],
    "images": [
      "data/00000.png"
    ]
  },
  ...
]
  • The <image> tag in the user message signals that the subsequent image (listed under images) should be used as input.
  • The assistant message contains the ground‑truth Unicode grapheme text.
  • The number of <image> tags must exactly match the number of entries in the images list.

Usage

  1. 1.Clone the repository and install the required tools (e.g., huggingface_hub).
  2. 2.Load the dataset in your training script (e.g., with LLaMA‑Factory) by pointing to devanagari_ocr_graphemes.json and ensuring the data/ folder is accessible.
  3. 3.Fine‑tune a multimodal model using the ShareGPT format; the model will learn to map the image of a Devanagari grapheme to its corresponding text.

License

The dataset is released under the CC‑BY‑4.0 license. Feel free to use, share, and adapt it, provided proper attribution is given.


Citation

If you use this dataset in a publication, please cite:

@dataset{devanagari_ocr_graphemes,
  author    = {Shubham Karampure et al.},
  title     = {Devanagari Grapheme OCR Dataset},
  year      = {2024},
  url       = {https://www.kaggle.com/datasets/shubhamkarampure/sanskrit-devanagari-graphemes},
  license   = {CC BY 4.0}
}

Enjoy training! 🎉