Number of scale in SinGAN
Opened this issue · 1 comments
lyphilong commented
Hello,
Thanks for the interesting paper and codes.
I have a question.
How do you known number of scale in SinGAN?
Thanks
Lotayou commented
Check this:
# In SINGAN.functions.py
def adjust_scales2image(real_,opt):
#opt.num_scales = int((math.log(math.pow(opt.min_size / (real_.shape[2]), 1), opt.scale_factor_init))) + 1
opt.num_scales = math.ceil((math.log(math.pow(opt.min_size / (min(real_.shape[2], real_.shape[3])), 1), opt.scale_factor_init))) + 1
scale2stop = math.ceil(math.log(min([opt.max_size, max([real_.shape[2], real_.shape[3]])]) / max([real_.shape[2], real_.shape[3]]),opt.scale_factor_init))
opt.stop_scale = opt.num_scales - scale2stop
Basically you start from the original resolution and scale down by 0.75 until the long side of the downscaled image hits 25.