sefibk / KernelGAN

Other
337 stars 77 forks source link

the settings for 2x downsampling #45

Open jiandandan001 opened 3 years ago

jiandandan001 commented 3 years ago

Hi. Thank you for sharing the code. Could you tell me how to set the following parametres when generating 2x downsampled lr testing images, so make the gererated images are consistent with the dataset you used? Thanks

scale_factor = np.array([4, 4]) # choose scale-factor avg_sf = np.mean(scale_factor) # this is calculated so that min_var and max_var will be more intutitive min_var = 0.175 avg_sf # variance of the gaussian kernel will be sampled between min_var and max_var max_var = 2.5 avg_sf k_size = np.array([21, 21]) # size of the kernel, should have room for the gaussian noise_level = 0.4 # this option allows deviation from just a gaussian, by adding multiplicative noise noise

jiandandan001 commented 3 years ago

also the parameters for 4x downsampling

sefibk commented 3 years ago

The dataset was generated with some randomness. You can either take what we generated or generate them yourself but it will not be identical.

jiandandan001 commented 3 years ago

The dataset was generated with some randomness. You can either take what we generated or generate them yourself but it will not be identical.

Thanks. Could you tell me the values of the following parameters you used to generate 2x/4x testing images?

scale_factor = np.array([4, 4]) # choose scale-factor avg_sf = np.mean(scale_factor) # this is calculated so that min_var and max_var will be more intutitive min_var = 0.175 avg_sf # variance of the gaussian kernel will be sampled between min_var and max_var max_var = 2.5 avg_sf k_size = np.array([21, 21]) # size of the kernel, should have room for the gaussian noise_level = 0.4 # this option allows deviation from just a gaussian, by adding multiplicative noise noise

sefibk commented 3 years ago

See section 5.2 in the paper. It includes all details, parameters and links

JingyunLiang commented 3 years ago

Section 5.2 doesn't specify the scale factors. Did you use the same settings (e.g. kernel width, rotation and noise) for both scale factor 2 and 4?

sefibk commented 3 years ago

Yes we generated x2 kernels with those parameters and downscaled the image twice or generated a x4 kernel analytically and downscaled once by 4 (2 identical possible ways)