mit-han-lab / anycost-gan

[CVPR 2021] Anycost GANs for Interactive Image Synthesis and Editing
https://hanlab.mit.edu/projects/anycost-gan/
MIT License
776 stars 97 forks source link

Default parameters for project.py do not recreate projected latents in assets/demo/projected_latents #16

Open CooperNederhood opened 3 years ago

CooperNederhood commented 3 years ago

Hello, great work! I am wondering what options you use to calculate the projected latents in assets/demo/projected_latents? I am trying to recreate them using the default parameters via: python3 tools/project.py 00_ryan.jpg But the resulting vectors are numerically different and, when viewed in demo.py: (1) the projected image is good but clearly different than the projected image preloaded in the repo and (2) the editing directions don't seem to work very well for this set of latent codes.

Below I've included a screenshot of the behavior I am seeing. Note the differences in his neckline from the demo projection and the lack of any meaningful change in the output image. image

tonylins commented 2 years ago

Hi, sorry for the late reply. Could you please provide the script you used to perform the projection?

To get a good projection, you should enable --encoder for a good initialization. --optimize_sub_g and add --enc_reg_weight will also potentially help to make the editing more obvious. We notice that sometimes when you improve the reconstruction, the editing ability could actually become worse. We think this is an open question pending research.

Alternatively, you can increase the max_value here (https://github.com/mit-han-lab/anycost-gan/blob/1177beafaf5ed486156f78f411c34e62f0d46f14/demo.py#L308) to increase the editing, if the effect is not obvious.