Need help with text_renderer?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

146 Stars 37 Forks 35 Commits 1 Opened issues

Services available


Need anything else?

Contributors list

No Data

Text Renderer

Generate text images for training deep learning OCR model (e.g. CRNN). example

  • [x] Modular design. You can easily add Corpus, Effect, Layout.
  • [x] Support generate
    dataset which compatible with PaddleOCR, see Dataset
  • [x] Support render multi corpus on image with different font, font size or font color. Layout is responsible for the layout between multiple corpora
  • [ ] Generate vertical text
  • [ ] Corpus sampler: helpful to perform character balance

Quick Start

To use text_renderer, you should prepare:

  • Font file:
  • Background image
  • Text: Optional. Depends on the corpus you use.
  • Character set: Optional. Depends on the corpus you use.

Run following command to generate image using example data:

git clone
cd text_renderer
python3 develop
pip3 install -r docker/requirements.txt
python3 \
    --config example_data/ \
    --dataset img \
    --num_processes 2 \
    --log_period 10

The data is generated in the

script only has 4 arguments: - config:Python config file path - dataset: Dataset format
- numprocesses: Number of processes used - logperiod: Period of log printing. (0, 100)

All parameters related to the example image generation process are all configured in

Learn more at documentation

Run in Docker

Build image

docker build -f docker/Dockerfile -t text_renderer .

Config file is provided by

environment. In
file, data is generated in
directory, so we map this directory to the host.
docker run --rm \
-v `pwd`/example_data/docker_output/:/app/example_data/output \
--env CONFIG=/app/example_data/ \
--env DATASET=img \
--env LOG_PERIOD=10 \

Build docs

cd docs
make html



We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.