Belval / TextRecognitionDataGenerator

A synthetic data generator for text recognition
MIT License
3.22k stars 960 forks source link

GeneratorFromStrings produces identical images every time #279

Open avber opened 2 years ago

avber commented 2 years ago

GeneratorFromStrings produces identical images every time

random.seed(100) # doesn't help

data = [] start = 200 for i in range(start, start + 3): data.append( str(i) + ' ' + '₸')

generator = GeneratorFromStrings( data, blur=0, random_blur=False, random_skew=True, )

image

Belval commented 2 years ago

Setting the seed will not "break" randomness. It will only ensure that if you regenerate the sequence it will look the same. As a general rule I have not spent much time on making sure sure repeatability worked so it's possible that setting the seed does not lock the actual image sequence, but your example is not showing that.

avber commented 2 years ago

The problem is that images are identical. I expected them to be different on each run. I tried to run the code several times and still got these same images.

Thanks