예제 #1
0
    def __getitem__(self, index):
        file_name = [self.dataset_dir + self.file_list[index]]
        with h5py.File(file_name[0], 'r') as hf:
            data_SAI_y = np.array(hf.get('Lr_SAI_y'))
            label_SAI_y = np.array(hf.get('Hr_SAI_y'))
            data_SAI_y, label_SAI_y = augmentation(data_SAI_y, label_SAI_y)
            data_SAI_y = ToTensor()(data_SAI_y.copy())
            label_SAI_y = ToTensor()(label_SAI_y.copy())

        return data_SAI_y, label_SAI_y
예제 #2
0
 def __getitem__(self, index):
     dataset_dir = self.dataset_dir
     index = index + 1
     file_name = [dataset_dir + '/%06d' % index + '.h5']
     with h5py.File(file_name[0], 'r') as hf:
         data = np.array(hf.get('data'))
         label = np.array(hf.get('label'))
         data, label = augmentation(data, label)
         data = ToTensor()(data.copy())
         label = ToTensor()(label.copy())
     return data, label
예제 #3
0
    def __getitem__(self, index):
        file_name = [self.dataset_dir + self.file_list[index]]
        with h5py.File(file_name[0], 'r') as hf:
            Lr_SAI_y = np.array(hf.get('Lr_SAI_y'))
            Hr_SAI_y = np.array(hf.get('Hr_SAI_y'))
            Lr_SAI_y = np.transpose(Lr_SAI_y, (1, 0))
            Hr_SAI_y = np.transpose(Hr_SAI_y, (1, 0))

        Lr_SAI_y = ToTensor()(Lr_SAI_y.copy())
        Hr_SAI_y = ToTensor()(Hr_SAI_y.copy())

        return Lr_SAI_y, Hr_SAI_y
예제 #4
0
    def __getitem__(self, index):
        file_name = self.dataset_dir + '/' + self.file_list[index]
        with h5py.File(file_name, 'r') as hf:
            data = np.array(hf.get('data'))
            label = np.array(hf.get('label'))
            data, label = np.transpose(data, (1, 0)), np.transpose(label, (1, 0))
            data, label = ToTensor()(data.copy()), ToTensor()(label.copy())

        return data, label