apchenstu / sofgan

[TOG 2022] SofGAN: A Portrait Image Generator with Dynamic Styling
Other
763 stars 102 forks source link

which function should I use to generate "region-wise distance map P" #21

Open Tianhang-Cheng opened 3 years ago

Tianhang-Cheng commented 3 years ago

hi, I have some questions about "region-wise distance map P"

If we use the "scatter_to_mask" function to generate style_mask, the region-wise distance map can only be 0 or 1

style_mask = scatter_to_mask(condition_img.clone(), labels)

image

Fig 1. style_mask generated by "scatter_to_mask" function

If we use "scatter_to_mask_perregion" function to generate style_mask, the region-wise distance map can be a float in [0,1]

style_mask = scatter_to_mask_perregion(condition_img.clone(), labels)

image

Fig 2. style_mask generated by "scatter_to_mask_perregion" function

My question is, I found that the released code uses "scatter_to_mask", but the picture of "style-mixing" in the paper is not a 0-1 binary mask. So could you please tell me which function should I use? Thank you very much!

I guess you use scatter_to_mask because it has better training results, while scatter_to_mask_perregion is used for visualization. haha.

image

Fig 3. "style mixing"

apchenstu commented 3 years ago

Hi there, thanks, both of these functions can be used for training and rendering, you could use any of them~