yuval-alaluf / SAM

Official Implementation for "Only a Matter of Style: Age Transformation Using a Style-Based Regression Model" (SIGGRAPH 2021) https://arxiv.org/abs/2102.02754
https://yuval-alaluf.github.io/SAM/
MIT License
632 stars 151 forks source link

Questions about image size #44

Closed kasim0226 closed 2 years ago

kasim0226 commented 2 years ago

Thank you for your great work.

I noticed you set FFHQ image size 256 in paths_config.py. However, the stylegan output size is 1024 in your training option setting.

I didn't find stylegan output is resized when calculating loss. Did I miss it?

If I want to train a model, input size is 256 and output is 1024. Should I set FFHQ 256 in paths_config.py and stylegan output size 1024? If so, how did you deal with image size of loss calculation?

Looking forward to your reply

yuval-alaluf commented 2 years ago

The images are resized inside the pSp model: https://github.com/yuval-alaluf/SAM/blob/15f0585ddf2501209854f6406c0da21da2a1a62b/models/psp.py#L92-L93

This resize will ensure that the inputs and outputs will be of the same size (256).

kasim0226 commented 2 years ago

Thank you for your reply