TextRecognitionDataGenerator icon indicating copy to clipboard operation
TextRecognitionDataGenerator copied to clipboard

ZeroDivisionError: float division by zero when generating handwritting text

Open cteckwee opened this issue 3 years ago • 0 comments

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 image.

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.

cteckwee avatar Feb 11 '22 02:02 cteckwee