csjliang / DASR

Official implementation of the paper 'Efficient and Degradation-Adaptive Network for Real-World Image Super-Resolution' in ECCV 2022
Apache License 2.0
128 stars 9 forks source link

degradation params #14

Open jiamingNo1 opened 2 years ago

jiamingNo1 commented 2 years ago

I have two questions.

  1. the sinc kernel_size may be negative when the prob larger than final_sinc_prob? https://github.com/csjliang/DASR/blob/ff2e1ec02c767b75d09b5d60f85c5cbd4115d058/dasr/models/DASR_model.py#L106
  2. why are the previous degradation params overwritten , that is to say, the sinc degradation_params[:, 9:10] is overwritten by the second blur prob? https://github.com/csjliang/DASR/blob/ff2e1ec02c767b75d09b5d60f85c5cbd4115d058/dasr/models/DASR_model.py#L161
yiyunchen commented 2 years ago

hello, I am also confused with the 'degradation_params', it seems that the images blurred by different sigma are get with the same 'degradation_params':

DASR_model.py#L100 self.degradation_params[:, self.road_map[0]+1:self.road_map[0]+2] = (data['kernel1']['sigma_x'].unsqueeze(1) - self.opt_train['blur_sigma'][0]) / (self.opt_train['blur_sigma'][1] - self.opt_train['blur_sigma'][0])

DASR_model.py#L257 self.degradation_params[:, self.road_map[0]+1:self.road_map[0]+2] = (data['kernel1']['sigma_x'].unsqueeze(1) - self.opt_train['blur_sigma_standard1'][0]) / (self.opt_train['blur_sigma_standard1'][1] - self.opt_train['blur_sigma_standard1'][0])

train_DASR.yml#L88 blur_sigma: [0.2, 3]

train_DASR.yml#L79 blur_sigma_standard1: [ 0.2, 1.5 ]

thus in DASR_model.py#L100: if sigma = 1, degradation_params[:, self.road_map[0]+1:self.road_map[0]+2] = (1 - 0.2)/(3 - 0.2) = 0.286

in DASR_model.py#L257 if sigma = 0.57, degradation_params[:, self.road_map[0]+1:self.road_map[0]+2] = (0.57 - 0.2)/(1.5 - 0.2) = 0.285

the sigma is quite different while the 'degradation_params' is quite similar, is this right?