amzn / convolutional-handwriting-gan

ScrabbleGAN: Semi-Supervised Varying Length Handwritten Text Generation (CVPR20)
https://www.amazon.science/publications/scrabblegan-semi-supervised-varying-length-handwritten-text-generation
MIT License
264 stars 55 forks source link

Generating a text line #27

Open ysig opened 2 years ago

ysig commented 2 years ago

Hi,

I see that the code can generate words. But I don't see how to generate a line consistently, i.e. give an input x = 'I like cats' and get an an output with similar backgrounds along characters and proper spacing.

Thanks,

rlit commented 2 years ago

Hi Thanks for your interest in this package.

As far as I recall we had, on some of the datasets, a token/character for white-space. you can use it to generate spaces. this is how we generated long sentences like here.

Note, however, that the inconsistent background is an artifact related to the IAM dataset, and is present in the train data (and hence the GAN generates it as well)

giangnv125 commented 1 year ago

Hello @rlit , Can you send me your code which generates a text line? My email is ngovangiang.hust@gmail.com. I hope to hear back from you soon.

rlit commented 1 year ago

Hi @giangnv125 It has been quite a while since I looked at this code (and I was not even the one who wrote it 🙂 ), so I cannot locate the neeed script I would recommend looking at the generation script to get the general gist of how to create a word, and especially the getImg function