### Install TRDG from Repository Source: https://github.com/belval/textrecognitiondatagenerator/blob/master/README.md If you want to add another language or contribute, clone the repository and install requirements.txt. This is an alternative to the PyPI package. ```bash pip install -r requirements.txt ``` -------------------------------- ### Install TRDG Package Source: https://github.com/belval/textrecognitiondatagenerator/blob/master/README.md Install the TextRecognitionDataGenerator package using pip. It is recommended to use a virtual environment. ```bash pip install trdg ``` -------------------------------- ### Basic Python Module Usage Source: https://github.com/belval/textrecognitiondatagenerator/blob/master/README.md Use TRDG as a Python module for more flexibility in training pipelines. This example uses GeneratorFromStrings. ```python from trdg.generators import ( GeneratorFromDict, GeneratorFromRandom, GeneratorFromStrings, GeneratorFromWikipedia, ) # The generators use the same arguments as the CLI, only as parameters generator = GeneratorFromStrings( ['Test1', 'Test2', 'Test3'], blur=2, random_blur=True ) for img, lbl in generator: # Do something with the pillow images here. ``` -------------------------------- ### Basic CLI Usage Source: https://github.com/belval/textrecognitiondatagenerator/blob/master/README.md Generate 1,000 random images with random text using the command-line interface. Images are saved to the 'out/' directory by default. ```bash trdg -c 1000 -w 5 -f 64 ``` -------------------------------- ### Pull and Run Docker Image Source: https://github.com/belval/textrecognitiondatagenerator/blob/master/README.md Pull the latest Docker image for TRDG and run it, mounting an output directory. The path must be absolute. ```bash docker pull belval/trdg:latest docker run -v /output/path/:/app/out/ -t belval/trdg:latest trdg [args] ``` -------------------------------- ### CLI Usage with Blurring Source: https://github.com/belval/textrecognitiondatagenerator/blob/master/README.md Generate images with Gaussian blur applied to the text using -bl and -rbl arguments. The radius can be specified for blur and random blur. ```bash trdg -c 1000 -w 5 -f 64 -bl -rbl ``` -------------------------------- ### CLI Usage with Skewing Source: https://github.com/belval/textrecognitiondatagenerator/blob/master/README.md Generate images with random text skewing using the -k and -rk arguments. This adds a random skew angle to the generated text. ```bash trdg -c 1000 -w 5 -f 64 -k 5 -rk ``` -------------------------------- ### CLI Usage with Distortion Source: https://github.com/belval/textrecognitiondatagenerator/blob/master/README.md Generate images with text distortion using the -d and -do arguments. This applies random distortions to the text. ```bash trdg -c 1000 -w 5 -f 64 -d -do ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.