task_categories:image-to-text language:id license:mit size_categories:100K<n<1M region:us ocr text-recognition scene-text-recognition
---
datasets:
- IndoSceneTextRecognition-Synth-120K
language:
- id
task_categories:
- image-to-text
size_categories:
- 100K<n<1M
license: mit
dataset_info:
  name: IndoSceneTextRecognition-Synth-120K
  description: >
    IndoSceneTextRecognition-Synth-120K is a synthetic dataset designed for
    training Scene Text Recognition (STR) models  in Indonesian and various
    regional languages of Indonesia. It contains 120,253 images, each with  text
    in either Bahasa Indonesia or a regional language. The dataset is in LMDB
    format.
  features:
  - image: Image (scene text)
  - label: String (ground truth text)
  source: https://huggingface.co/datasets/IndoSceneTextRecognition-Synth-120K
  citation: |
    @misc{IndoText120K,
      author = {Muhammad Abdan Mulia},
      title = {IndoSceneTextRecognition-Synth-120K: Multilingual Indonesian Scene Text Recognition Dataset},
      year = {2025},
      publisher = {Hugging Face},
      howpublished = {\url{https://huggingface.co/datasets/IndoSceneTextRecognition-Synth-120K}}
    }
tags:
- ocr
- text-recognition
- scene-text-recognition
pretty_name: IndonesiaSceneTextRecognition-Synth-120K
---
# IndoSceneTextRecognition-Synth-120K: Multilingual Indonesian Scene Text Recognition Dataset

## Overview
**IndoSceneTextRecognition-Synth-120K** is a synthetic dataset designed for training Scene Text Recognition (STR) models in Indonesian and various regional languages of Indonesia. The dataset consists of **120,253 images**, each containing text in either Bahasa Indonesia or one of Indonesia's many regional languages. 

## Features
- **Multilingual**: Includes text in Bahasa Indonesia and several regional languages of Indonesia.
- **Scene Text Recognition (STR)**: Specifically created for training OCR models to recognize text in natural scene images.
- **Synthetic Data**: Generated synthetically to simulate real-world scenarios for robust training.
- **LMDB Format**: The dataset is stored in LMDB format for efficient reading and processing.

## Data Structure
Each sample in the dataset consists of:
- An **image** containing text in Indonesian or a regional language.
- A **label** corresponding to the ground-truth text in the image.

## Example Code for Reading the Dataset from Hugging Face
You can use the following Python script to read and extract images and labels from the LMDB dataset hosted on Hugging Face:

```python
from datasets import load_dataset
import lmdb
import io
import numpy as np
from PIL import Image

def read_huggingface_lmdb(dataset_name, num_samples=100000000):
    """
    Reads LMDB dataset from Hugging Face and prints image shapes and labels.

    Args:
        dataset_name (str): Name of the Hugging Face dataset.
        num_samples (int): Number of samples to display.
    """
    dataset = load_dataset(dataset_name)  # No split needed
    lmdb_path = dataset.cache_files[0]['filename']
    
    env = lmdb.open(lmdb_path, subdir=False, readonly=True, lock=False)
    
    with env.begin(write=False) as txn:
        for i in range(1, num_samples + 1):
            image_key = f"image-{i:09d}".encode()
            label_key = f"label-{i:09d}".encode()
            
            image_data = txn.get(image_key)
            label_data = txn.get(label_key)
            
            if image_data is None or label_data is None:
                print(f"Sample {i} missing in LMDB.")
                break

            # Convert image bytes to PIL image
            img = Image.open(io.BytesIO(image_data))
            img.save(f"{i}.png")
            img_array = np.array(img)

            # Decode label
            label = label_data.decode()

            print(f"Sample {i}: Image Shape: {img_array.shape}, Label: {label}")
    
    env.close()

if __name__ == "__main__":
    dataset_name = "IndoSceneTextRecognition-Synth-120K"
    read_huggingface_lmdb(dataset_name)
```

## Usage
This dataset can be used for:
- Training and evaluating **OCR models** for Indonesian and regional languages.
- Developing multilingual **scene text recognition** applications.
- Research in **low-resource languages** and **synthetic dataset augmentation**.

## Citation
If you use **IndoSceneTextRecognition-Synth-120K** in your research or project, please cite this dataset as follows:

```bibtex
@misc{IndoSceneTextRecognitionSynth120K,
  author = {Muhammad Abdan Mulia},
  title = {IndoSceneTextRecognition-Synth-120K: Multilingual Indonesian Scene Text Recognition Dataset},
  year = {2025},
  publisher = {Hugging Face},
  howpublished = {\url{https://huggingface.co/datasets/IndoSceneTextRecognition-Synth-120K}}
}
```

---
For any questions or collaborations, feel free to reach out!