File size: 5,761 Bytes
cbe99f7 46701d1 7c12731 402b740 46701d1 7fd5ca4 a534399 7fd5ca4 51fe055 7fd5ca4 51fe055 7fd5ca4 51fe055 7fd5ca4 a534399 7fd5ca4 a534399 7fd5ca4 2a1905d 7fd5ca4 2a1905d 7fd5ca4 2a1905d 7fd5ca4 2a1905d 7fd5ca4 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 |
---
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](https://github.com/clovaai/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
```python
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!
```python
# 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
```python
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](https://gitlab.com/czech-cc0-dictionaries/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:
```bibtex
@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:
```bibtex
@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](https://github.com/clovaai/synthtiger) for license details.
## Acknowledgments
- Dataset generated using [SynthTiger](https://github.com/clovaai/synthtiger)
- Czech word corpus from [czech-cc0-dictionaries](https://gitlab.com/czech-cc0-dictionaries/czech-cc0-dictionaries) (CC0 license) |