Skip to main content

🍞 TextBaker

CI Coverage Status PyPI version PyPI Downloads Python 3.9+ License: MIT Code style: ruff Docs

⚠️ Disclaimer: This project was developed with the assistance of AI tools (GitHub Copilot). While efforts have been made to ensure quality, it may still contain errors or bugs. Use at your own discretion and feel free to report any issues.

Synthetic Text Dataset Generator for OCR Training

TextBaker generates synthetic text images by combining character datasets with backgrounds and applying transformations. Perfect for training OCR models and data augmentation.

TextBaker Icon

🖼️ Example Outputs

Basic Transformed Colored Background Texture Full Pipeline
Basic Rotated Colored Background Texture Full

📖 See Examples Documentation for code samples.

✨ Features

  • 🎨 GUI Application - Interactive interface for real-time text generation
  • ✏️ Custom Character Drawing - Draw and save custom characters directly in the app
  • ✂️ Character Segmentation - Extract characters from images using polygon selection
  • 🖥️ CLI Tool - Batch processing from command line
  • 📚 Python Library - Programmatic API for integration
  • 🔄 Transformations - Rotation, perspective, scale, shear
  • 🎭 Textures & Backgrounds - Apply overlays and composite on images
  • 🔧 YAML/JSON Configs - Save and load configurations

📦 Installation

pip install textbaker

Or from source:

git clone https://github.com/q-viper/text-baker.git
cd text-baker
pip install -e .

🚀 Quick Start

GUI

textbaker

CLI

# Generate specific texts
textbaker generate "Hello" "World" -d ./dataset -o ./output

# Generate random samples with transforms
textbaker generate -n 100 --seed 42 -r "-15,15" -b ./backgrounds

Python

from textbaker import TextGenerator, GeneratorConfig

generator = TextGenerator()
result = generator.generate("Hello")
generator.save(result)

📖 See full documentation for detailed usage.

📁 Dataset Structure

dataset/
├── A/
│   ├── sample1.png
│   └── sample2.png
├── B/
│   └── ...
└── 0/
    └── ...

📖 Documentation

🧪 Development

git clone https://github.com/q-viper/text-baker.git
cd text-baker
pip install -e ".[dev]"

# Run tests
pytest tests/ -v

# Run linting
ruff check . && ruff format .

📄 License

MIT License - see LICENSE for details.

🤝 Contributing

Contributions welcome! Please fork, create a feature branch, and submit a PR.

👤 Author

Ramkrishna Acharya (@q-viper)


Built with PySide6, OpenCV, and Typer

Metadata

Release files for textbaker 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for textbaker 0.1.6
File Size Uploaded
textbaker-0.1.6.tar.gz 57.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for textbaker 0.1.6
File Interpreter ABI Platform
textbaker-0.1.6-py3-none-any.whl Python 3 none any Details

Total release size: 114.0 kB

Release files / textbaker-0.1.6.tar.gz

Download URL textbaker-0.1.6.tar.gz
Size 57.1 kB
Tags Source
SHA-256 checksum
How to use checksums
0bd560d067e35dd02fa1ccfc35b71d653bddc013070fa14d49403b99db7cff49
BLAKE2b-256 checksum
How to use checksums
45678a66334d3acb6320f4fb64dc7290dc05be49cc9b273483c950bc16626618
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / textbaker-0.1.6-py3-none-any.whl

Download URL textbaker-0.1.6-py3-none-any.whl
Size 56.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
75b1814cfaea5d5407d351738698815726e4cc2df68a33d196f4d65f70a9cf0e
BLAKE2b-256 checksum
How to use checksums
95c0b87b83fe3f130c06997c60d1746237c6877abf16e9b917023f74c05a0eb1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release history Release notifications | RSS feed

This release

0.1.6 This release

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page