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

What is the purpose of destylization? #107

Open
Lun-menG opened this issue Jul 31, 2024 · 10 comments
Open

What is the purpose of destylization? #107

Lun-menG opened this issue Jul 31, 2024 · 10 comments

Comments

@Lun-menG
Copy link

Hello, I'm considering whether I would need destylization if I already have a paired dataset. What is the purpose of destylization? Is it to generate paired datasets, or is it to encode the destylized images to obtain the content latent codes?Is destylization significantly important? Do we need the intermediate semantic features from the destylization process, or do we simply use the destylized images for encoding? If I use real paired images to obtain these codes, would it be okay to skip the destylization step?

@williamyang1991
Copy link
Owner

You can skip the destylization step if you already have paired dataset.

@Lun-menG
Copy link
Author

Lun-menG commented Aug 4, 2024

请问外在风格和内在风格用的是同一个编码器吗

@williamyang1991
Copy link
Owner

是一个

@Lun-menG
Copy link
Author

Lun-menG commented Aug 5, 2024

是一个

好的,谢谢

@Lun-menG
Copy link
Author

Lun-menG commented Aug 6, 2024

是一个

请问你这个encoder是自己训练的吗,还是在psp项目上微调的

@williamyang1991
Copy link
Owner

我在psp项目上自己训练的。因为psp release的模型都是W+的,不是Z+的,所以只能重新训练。

@Lun-menG
Copy link
Author

Lun-menG commented Aug 6, 2024

我在psp项目上自己训练的。因为psp release的模型都是W+的,不是Z+的,所以只能重新训练。

哦哦,明白了,那您看,您方便给我发一份训练encoder的代码吗,或者可以给我说一下您训练encoder的细节吗,我想在这个encoder上面微调以符合我的任务

@williamyang1991
Copy link
Owner

代码就是psp项目的,只不过把W+换成了Z+,其他设置都是和psp项目原本的参数一样的。
我因为换工作单位了,所以之前的服务器访问不了,而这部分我没有整理代码,所以手头没有代码

@williamyang1991
Copy link
Owner

大概就是这些地方修改了

if z_plus_latent:
input_is_latent = False
images, result_latent = self.decoder([codes],
input_is_latent=input_is_latent,
randomize_noise=randomize_noise,
return_latents=return_latents,
z_plus_latent=z_plus_latent)

if not z_plus_latent:
styles = [self.style(s) for s in styles]
else:
styles_ = []
for s in styles:
style_ = []
for i in range(s.shape[1]):
style_.append(self.style(s[:,i]).unsqueeze(1))
styles_.append(torch.cat(style_,dim=1))
styles = styles_

@Lun-menG
Copy link
Author

Lun-menG commented Aug 6, 2024

大概就是这些地方修改了

if z_plus_latent:
input_is_latent = False
images, result_latent = self.decoder([codes],
input_is_latent=input_is_latent,
randomize_noise=randomize_noise,
return_latents=return_latents,
z_plus_latent=z_plus_latent)

if not z_plus_latent:
styles = [self.style(s) for s in styles]
else:
styles_ = []
for s in styles:
style_ = []
for i in range(s.shape[1]):
style_.append(self.style(s[:,i]).unsqueeze(1))
styles_.append(torch.cat(style_,dim=1))
styles = styles_

哦哦好的,十分感谢

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