LeiaLi / SRDiff

171 stars 19 forks source link

网络输出的结果与LR的大小相同与scale的值无关 #16

Open wojiaimt opened 1 year ago

wojiaimt commented 1 year ago

我使用的是作者给的数据集celeba和Lr_x8_celeba进行测试,通过作者给的代码来看'lr_up'并没有对LR图像上采样,读取的是16×16的图像 然后通过sr = model(to_device(data, device))输出的结果sr[img_out’]仍然是16×16,我设置的scale=8,不能理解?是不是'lr_up'应该上采样之后再输给网络,求教。 def getitem(self, item):

    img_path_LR = os.path.join(self.imgs_LR_path, self.imgs_LR[item])
    img_path_HR = os.path.join(self.imgs_HR_path, self.imgs_HR[item])

    LR = Image.open(img_path_LR)
    HR = Image.open(img_path_HR)

    HR = np.array(HR)
    LR = np.array(LR)

    LR = np.ascontiguousarray(LR)
    HR = np.ascontiguousarray(HR)
    HR = ToTensor()(HR)
    LR = ToTensor()(LR)
    filename = os.path.basename(img_path_HR)

    return {'lr_up': LR, 'img_gt': HR, 'img_name': filename}