TextRecognitionDataGenerator
TextRecognitionDataGenerator copied to clipboard
ZeroDivisionError: float division by zero when generating handwritting text
Realise that the mask set to (0,0,0) at line 230 in handwritten_text_generator.py will cause ZeroDivisionError at line 186 in data_generator.py
.
I believe it is due to all pixels are masked out that's why Pillow stats unable to compute statistic. Since the handwritten text generated is rather thin, I am thinking a quick fix would be just setting the mask to (255,255,255). Tested it seems working fine.