herobd / handwriting_line_generation

Code for BMVC2020 paper "Text and Style Conditioned GAN for Generation of Offline Handwriting Lines"
Other
66 stars 28 forks source link

UMAPing #19

Open AlxJude opened 3 years ago

AlxJude commented 3 years ago

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

herobd commented 3 years ago

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.

AlxJude commented 3 years ago

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

herobd commented 3 years ago

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

herobd commented 3 years ago

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

AlxJude commented 3 years ago

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

herobd commented 3 years ago

Could you attach the style images and a generated image?

AlxJude commented 3 years ago

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

a01-000u-00

a01-000u-01

gen0_1

herobd commented 3 years ago

Are you using the pre-trained model?

AlxJude commented 3 years ago

No, I trained with IAM dataset.

herobd commented 3 years ago

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

AlxJude commented 3 years ago

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

AlxJude commented 3 years ago

Unfortunately, I'm getting the #12 issue.

herobd commented 3 years ago

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

AlxJude commented 3 years ago

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

herobd commented 3 years ago

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.

AlxJude commented 3 years ago

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.

herobd commented 3 years ago

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.

AlxJude commented 3 years ago

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