handwriting_line_generation icon indicating copy to clipboard operation
handwriting_line_generation copied to clipboard

UMAPing

Open AlxJude opened this issue 3 years ago • 18 comments

Hello again,

I have completed generating the styles.pkl using the generate.py.

Save styles using get_styles.py Then umap_styles.py styles.pkl [image dir]

Could you please tell the format and type of the files present in the image_dir and from where I can get these files. An ordered.txt is required. Thank you for your help.

PS. import os is missing in umap_styles.py

AlxJude avatar Jul 21 '21 14:07 AlxJude

You can leave off the image directory argument. I believe it was to allow the images themselves to be plotted as points; I don't think I ever actually got it working properly.

herobd avatar Jul 21 '21 17:07 herobd

Oh okay. Could you please guide me on how to generate a new handwritten image?

AlxJude avatar Jul 21 '21 20:07 AlxJude

That is what generate.py is for, sorry that wasn't clear in the README. It provides several different ways to generate.

herobd avatar Jul 21 '21 21:07 herobd

The f option (from-to) is probably the simplist as it doesn't require the style pickle.

herobd avatar Jul 21 '21 21:07 herobd

I tried with the f option. Unfortunately, I'm getting blurred image for all the generated results.

AlxJude avatar Jul 22 '21 08:07 AlxJude

Could you attach the style images and a generated image?

herobd avatar Jul 22 '21 15:07 herobd

These are the images 1 and 2 and the generated image:

a01-000u-00

a01-000u-01

gen0_1

AlxJude avatar Jul 22 '21 15:07 AlxJude

Are you using the pre-trained model?

herobd avatar Jul 22 '21 15:07 herobd

No, I trained with IAM dataset.

AlxJude avatar Jul 22 '21 16:07 AlxJude

Try the pre-trained model to be sure that works.

herobd avatar Jul 22 '21 16:07 herobd

You are talking about this one, right?
https://github.com/herobd/handwriting_line_generation/releases/tag/w1.0

AlxJude avatar Jul 22 '21 16:07 AlxJude

Unfortunately, I'm getting the #12 issue.

AlxJude avatar Jul 22 '21 16:07 AlxJude

And you've pulled the latest code? All import mmd_hw_dataset should be gone...

herobd avatar Jul 22 '21 16:07 herobd

I used the above link to download the IAM weights and the Source code (tar.gz)

AlxJude avatar Jul 22 '21 16:07 AlxJude

So that "realese" doesn't have the latest code. It's just a hack way of attaching the weights to the repo. Pull the latest code from the repo itself.

herobd avatar Jul 22 '21 16:07 herobd

It works perfectly using the pre-trained. I had performed some explicit type conversions before you pushed the #17 I will try training it again.

This is a wonderful project. You guys have done a brilliant job.

AlxJude avatar Jul 22 '21 16:07 AlxJude

Thanks! During training it will save images every X iterations. Check these to be sure it's training correctly as something was going wrong before. The parameters controlling this in the config are print_dir: The directory it will save them to print_every: Save new images after this many iterations (overwrites previous) serperate_print_every: Saves images under a new directory so that they are not overwritten after this many iterations.

herobd avatar Jul 22 '21 16:07 herobd

Thank you for mentioning the tracking parameters. Now I can see that the images are becoming more and more legible through iterations.

AlxJude avatar Jul 22 '21 18:07 AlxJude