Example #1
0
    def __init__(self, opt):
        super(LRHRfromtxt, self).__init__()
        self.opt = opt
        self.train = (opt['phase'] == 'train')
        self.split = 'train' if self.train else 'test'
        self.scale = self.opt['scale']
        self.paths_HR, self.paths_LR = None, None
        self.qualityscore = None
        self.list_LR = []
        self.list_HR = []
        
        # change the length of train dataset (influence the number of iterations in each epoch)
        self.repeat = 2

        # read image list from image/binary files
        self.paths_LR, self.paths_HR, self.qualityscore = common.get_image_paths_from_txt(self.opt['txtpath'],1)
        
        for i in range(len(self.paths_LR)):
            lr_path = self.paths_LR[i]
            hr_path = self.paths_HR[i]
            lr = common.read_img_fromtxt(lr_path, self.opt['data_type'])
            hr = common.read_img_fromtxt(hr_path, self.opt['data_type'])
            self.list_LR.append(lr) 
            self.list_HR.append(hr) 
        
        assert self.paths_HR, '[Error] HR paths are empty.'
        if self.paths_LR and self.paths_HR:
            assert len(self.paths_LR) == len(self.paths_HR), \
                '[Error] HR: [%d] and LR: [%d] have different number of images.'%(
                len(self.paths_LR), len(self.paths_HR))
Example #2
0
    def __init__(self, opt):
        super(LR3HRfromtxt, self).__init__()
        self.opt = opt
        self.train = (opt['phase'] == 'train')
        self.split = 'train' if self.train else 'test'
        self.scale = self.opt['scale']
        self.paths_HR, self.paths_LR1 , self.paths_LR2 = None, None, None        
        
        # change the length of train dataset (influence the number of iterations in each epoch)
        self.repeat = 2

        # read image list from image/binary files
        self.paths_LR1, self.paths_LR2, self.paths_LR3 = common.get_image_paths_from_txt(self.opt['LRtxtpath'],1)
        self.paths_HR, _, _ = common.get_image_paths_from_txt(self.opt['HRtxtpath'],0)
        
        assert self.paths_HR, '[Error] HR paths are empty.'
        if self.paths_LR1 and self.paths_HR:
            assert len(self.paths_LR1) == len(self.paths_HR), \
                '[Error] HR: [%d] and LR: [%d] have different number of images.'%(
                len(self.paths_LR1), len(self.paths_HR))
Example #3
0
    def __init__(self, opt):
        super(LRfromtxt, self).__init__()
        self.opt = opt
        self.scale = self.opt['scale']
        self.paths_LR1 = None
        self.paths_LR2 = None
        self.paths_LR3 = None
        # read image list from image/binary files
        self.paths_LR1, self.paths_LR2, self.paths_LR3 = common.get_image_paths_from_txt(
            self.opt['LRtxtpath'], 1)

        for i in range(len(self.paths_LR1)):
            lr_path1 = self.paths_LR1[i]
            lr_path2 = self.paths_LR2[i]
            lr_path3 = self.paths_LR3[i]

        assert self.paths_LR1, '[Error] LR paths are empty.'