Empatixx's picture
Update README.md
402b740 verified
metadata
pretty_name: czech-synth-text-2025
size_categories:
  - 100K<n<1M
dataset_info:
  features:
    - name: image
      dtype: image
    - name: text
      dtype: string
  splits:
    - name: train
      num_bytes: 2156337658.4
      num_examples: 454820
  download_size: 2117123960
  dataset_size: 2156337658.4
configs:
  - config_name: default
    data_files:
      - split: train
        path: data/train-*
language:
  - cs
license: mit

Czech Synthetic Text Recognition Dataset

A large-scale synthetic dataset for Czech text recognition, containing 454,820 text images with corresponding transcriptions. Created using SynthTiger.

Dataset Description

This dataset consists of synthetically generated images of Czech text, designed for training optical character recognition (OCR) models. Each image contains a single word or short phrase rendered with various visual effects to simulate real-world text appearance.

Dataset Statistics

  • Total samples: 454,820 image-text pairs
  • Language: Czech (cs_CZ)
  • Image format: JPEG
  • Storage format: Parquet files (5 shards in data/ folder)
  • Total size: ~1.96 GB

Dataset Structure

The dataset is stored in HuggingFace's optimized format with automatic image display support:

data/
├── train-00000-of-00005-*.parquet
├── train-00001-of-00005-*.parquet
├── train-00002-of-00005-*.parquet
├── train-00003-of-00005-*.parquet
└── train-00004-of-00005-*.parquet

Each Parquet file contains two columns:

  • image: PIL Image object (JPEG format, automatically displayed in dataset viewer)
  • text: Ground truth text transcription

Usage

Loading with Hugging Face Datasets

from datasets import load_dataset

# Load the entire dataset
dataset = load_dataset("Empatixx/synth-text-recognition-cs")

# Access samples
sample = dataset['train'][0]
image = sample['image']  # PIL Image object
text = sample['text']    # Text transcription

# Load specific splits or streaming
dataset = load_dataset("Empatixx/synth-text-recognition-cs", split="train[:1000]")  # First 1000 samples
dataset = load_dataset("Empatixx/synth-text-recognition-cs", streaming=True)  # Stream the dataset

Direct Loading from Repository

The dataset now has proper Image type support, so images will display automatically in the HuggingFace dataset viewer!

# Images are automatically loaded as PIL Image objects
sample = dataset['train'][0]
image = sample['image']  # Already a PIL Image, not bytes!
image.show()  # Display the image

# Get the text transcription
text = sample['text']
print(f"Text: {text}")

PyTorch DataLoader Example

from datasets import load_dataset
from torch.utils.data import DataLoader
from torchvision import transforms

# Load dataset
dataset = load_dataset("Empatixx/synth-text-recognition-cs")

# Define transforms
transform = transforms.Compose([
    transforms.Resize((32, 128)),
    transforms.ToTensor(),
])

# Create DataLoader
def collate_fn(batch):
    images = [transform(sample['image']) for sample in batch]
    texts = [sample['text'] for sample in batch]
    return torch.stack(images), texts

dataloader = DataLoader(
    dataset['train'],
    batch_size=32,
    shuffle=True,
    collate_fn=collate_fn
)

Generation Details

The dataset was generated using SynthTiger with the following characteristics:

Text Sources

  • Czech words from czech-cc0-dictionaries (CC0 licensed)
  • Text lengths: 1-25 characters
  • Character set: Czech alphabet including diacritics (ěščřžýáíéůú)

Visual Variations

  • Fonts: Arimo-Regular, OpenSans-Regular, Roboto-Regular, Tinos-Regular (sizes 40-80px)
  • Colors: Diverse color schemes from predefined colormaps
  • Effects: Borders, shadows, and 3D extrusion effects
  • Transformations: Perspective, rotation, shearing, and elastic distortions
  • Backgrounds: Textured backgrounds with varying complexity
  • Quality: JPEG compression with quality 50-95

Text Rendering Styles

  • Horizontal text layout
  • Both curved and straight text
  • Various text effects including:
    • Border effects (25% probability)
    • Shadow effects (50% probability)
    • Extrusion effects (10% probability)

Dataset Creation

The dataset was created using the following process:

  1. Text Generation: Czech words selected from corpus files
  2. Visual Rendering: Text rendered with random fonts, colors, and effects
  3. Background Generation: Synthetic backgrounds with textures and patterns
  4. Post-processing: Geometric transformations, noise, and compression
  5. Format Conversion: Original files converted to Parquet format for efficiency

Citation

If you use this dataset, please cite:

@misc{czech-synth-text-2025,
  title={Czech Synthetic Text Recognition Dataset},
  author={Empatixx},
  year={2025},
  publisher={Hugging Face},
  url={https://huggingface.co/datasets/Empatixx/synth-text-recognition-cs}
}

Also cite the SynthTiger paper:

@inproceedings{yoo2021synthtiger,
  title={SynthTiger: Synthetic Text Image Generator Towards Better Text Recognition Models},
  author={Yoo, Moonbin and Shin, Yoonsik and Paek, Seunghyun},
  booktitle={ICDAR},
  year={2021}
}

License

This dataset is released under the same license as SynthTiger. Please refer to the original SynthTiger repository for license details.

Acknowledgments