Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing some words or random strokes in output images #10

Open
AkashDataScience opened this issue Oct 31, 2023 · 1 comment
Open

Missing some words or random strokes in output images #10

AkashDataScience opened this issue Oct 31, 2023 · 1 comment

Comments

@AkashDataScience
Copy link

I generated images for 50 different strings. 20% of them have half sentences or random strokes. I set bias to 1 and thickness to 10 (default). Is there any limit on word count or other variable effecting output image?

@X-rayLaser
Copy link
Owner

X-rayLaser commented Oct 31, 2023

This is a known problem. Sometimes, the model goes crazy after sampling certain number of points. Also, the model seems to struggle with producing rare letters and words. It is possible that it is somewhat undertrained or the dataset it was trained on contains some corrupted examples. Perhaps, there is also a bug in data preparation code. In either case, there is no way to flexibly control the output and prevent those failure cases.

You can try different checkpoints or experiment with the bias parameter. Surprisingly, I observed quite a bit more failures with bias=1 than with smaller ones.

As for the word count, there is a hardcoded attribute num_steps set to 1500 on this line:

return cls(model, mu, sd, charset, num_steps=1500)

This attribute sets the maximum number of points to generate for a given handwriting. You can try bigger values if this value is not big enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants