def __init__(self, raft_path='/data2/opticalflow/algo_comp/flownet2/out/', root_path='/data2/opticalflow/KLENS/images/', root_path2='/data2/opticalflow/KLENS/pins/', filenumberlist=['0030', '1106', '1113', '1132', '1134', '1167', '1173'], split='train', ref='', meas=''):
    super(KLens, self).__init__()
    self.split = split
    raftflowpaths = glob.glob(os.path.join(raft_path, '*.flo'))
    file_list = {}
    file_list['train'] = []
    file_list['valid'] = []
    file_list['test'] = []
    file_list['train+valid'] = []
    for filenum in filenumberlist:
        for raftflowpath in raftflowpaths:
            if (('KLE_' + filenum) in raftflowpath):
                file_list['train'].append([os.path.join(root_path, (('KLE_' + filenum) + '.jpg3.png')), os.path.join(root_path, (('KLE_' + filenum) + '.jpg5.png')), raftflowpath])
    file_list['train'].extend([[os.path.join(root_path, 'KLE_0309_exp_sub5.jpg'), os.path.join(root_path, 'KLE_0309_exp_sub6.jpg')], [os.path.join(root_path, 'KLE_0730_sub5.jpg'), os.path.join(root_path, 'KLE_0730_sub6.jpg')], [os.path.join(root_path, 'KLE_0747_sub5.jpg'), os.path.join(root_path, 'KLE_0747_sub6.jpg')], [os.path.join(root_path, 'KLE_9797clean_sub5.jpg'), os.path.join(root_path, 'KLE_9797clean_sub6.jpg')], [os.path.join(root_path, 'KLE_9803clean_sub5.jpg'), os.path.join(root_path, 'KLE_9803clean_sub6.jpg')], [os.path.join(root_path, 'NKM_0063_sub5.jpg'), os.path.join(root_path, 'NKM_0063_sub6.jpg')], [os.path.join(root_path, 'NKM_0109_sub5.jpg'), os.path.join(root_path, 'NKM_0109_sub6.jpg')], [os.path.join(root_path, 'scene_1_sub5.jpg'), os.path.join(root_path, 'scene_1_sub6.jpg')]])
    file_list['valid'].extend([[os.path.join(root_path, 'KLE_0309_exp_sub5.jpg'), os.path.join(root_path, 'KLE_0309_exp_sub6.jpg')], [os.path.join(root_path, 'KLE_0730_sub5.jpg'), os.path.join(root_path, 'KLE_0730_sub6.jpg')], [os.path.join(root_path, 'KLE_0747_sub5.jpg'), os.path.join(root_path, 'KLE_0747_sub6.jpg')], [os.path.join(root_path, 'KLE_9797clean_sub5.jpg'), os.path.join(root_path, 'KLE_9797clean_sub6.jpg')], [os.path.join(root_path, 'KLE_9803clean_sub5.jpg'), os.path.join(root_path, 'KLE_9803clean_sub6.jpg')], [os.path.join(root_path, 'NKM_0063_sub5.jpg'), os.path.join(root_path, 'NKM_0063_sub6.jpg')], [os.path.join(root_path, 'NKM_0109_sub5.jpg'), os.path.join(root_path, 'NKM_0109_sub6.jpg')], [os.path.join(root_path, 'scene_1_sub5.jpg'), os.path.join(root_path, 'scene_1_sub6.jpg')]])
    file_list['test'].extend([[os.path.join(root_path, 'KLE_0309_exp_sub5.jpg'), os.path.join(root_path, 'KLE_0309_exp_sub6.jpg')], [os.path.join(root_path, 'KLE_0730_sub5.jpg'), os.path.join(root_path, 'KLE_0730_sub6.jpg')], [os.path.join(root_path, 'KLE_0747_sub5.jpg'), os.path.join(root_path, 'KLE_0747_sub6.jpg')], [os.path.join(root_path, 'KLE_9797clean_sub5.jpg'), os.path.join(root_path, 'KLE_9797clean_sub6.jpg')], [os.path.join(root_path, 'KLE_9803clean_sub5.jpg'), os.path.join(root_path, 'KLE_9803clean_sub6.jpg')], [os.path.join(root_path, 'NKM_0063_sub5.jpg'), os.path.join(root_path, 'NKM_0063_sub6.jpg')], [os.path.join(root_path, 'NKM_0109_sub5.jpg'), os.path.join(root_path, 'NKM_0109_sub6.jpg')], [os.path.join(root_path, 'scene_1_sub5.jpg'), os.path.join(root_path, 'scene_1_sub6.jpg')]])
    file_list['train+valid'].extend([[os.path.join(root_path, 'KLE_0309_exp_sub5.jpg'), os.path.join(root_path, 'KLE_0309_exp_sub6.jpg')], [os.path.join(root_path, 'KLE_0730_sub5.jpg'), os.path.join(root_path, 'KLE_0730_sub6.jpg')], [os.path.join(root_path, 'KLE_0747_sub5.jpg'), os.path.join(root_path, 'KLE_0747_sub6.jpg')], [os.path.join(root_path, 'KLE_9797clean_sub5.jpg'), os.path.join(root_path, 'KLE_9797clean_sub6.jpg')], [os.path.join(root_path, 'KLE_9803clean_sub5.jpg'), os.path.join(root_path, 'KLE_9803clean_sub6.jpg')], [os.path.join(root_path, 'NKM_0063_sub5.jpg'), os.path.join(root_path, 'NKM_0063_sub6.jpg')], [os.path.join(root_path, 'NKM_0109_sub5.jpg'), os.path.join(root_path, 'NKM_0109_sub6.jpg')], [os.path.join(root_path, 'scene_1_sub5.jpg'), os.path.join(root_path, 'scene_1_sub6.jpg')]])
    self.dataset = file_list
def __init__(self, raft_path='/data2/opticalflow/algo_comp/flownet2/out/', root_path='/data2/opticalflow/KLENS/images/', root_path2='/data2/opticalflow/KLENS/pins/', filenumberlist=['0030', '1106', '1113', '1132', '1134', '1167', '1173'], split='train', ref=, meas=):
    super(KLens, self).__init__()
    self.split = split
    raftflowpaths = glob.glob(os.path.join(raft_path, '*.flo'))
    file_list = {}
    file_list['train'] = []
    file_list['valid'] = []
    file_list['test'] = []
    file_list['train+valid'] = []
    for filenum in filenumberlist:
        for raftflowpath in raftflowpaths:
            if (('KLE_' + filenum) in raftflowpath):
                file_list['train'].append([os.path.join(root_path, (('KLE_' + filenum) + '.jpg3.png')), os.path.join(root_path, (('KLE_' + filenum) + '.jpg5.png')), raftflowpath])
    file_list['train'].extend([[os.path.join(root_path, 'KLE_0309_exp_sub5.jpg'), os.path.join(root_path, 'KLE_0309_exp_sub6.jpg')], [os.path.join(root_path, 'KLE_0730_sub5.jpg'), os.path.join(root_path, 'KLE_0730_sub6.jpg')], [os.path.join(root_path, 'KLE_0747_sub5.jpg'), os.path.join(root_path, 'KLE_0747_sub6.jpg')], [os.path.join(root_path, 'KLE_9797clean_sub5.jpg'), os.path.join(root_path, 'KLE_9797clean_sub6.jpg')], [os.path.join(root_path, 'KLE_9803clean_sub5.jpg'), os.path.join(root_path, 'KLE_9803clean_sub6.jpg')], [os.path.join(root_path, 'NKM_0063_sub5.jpg'), os.path.join(root_path, 'NKM_0063_sub6.jpg')], [os.path.join(root_path, 'NKM_0109_sub5.jpg'), os.path.join(root_path, 'NKM_0109_sub6.jpg')], [os.path.join(root_path, 'scene_1_sub5.jpg'), os.path.join(root_path, 'scene_1_sub6.jpg')]])
    file_list['valid'].extend([[os.path.join(root_path, 'KLE_0309_exp_sub5.jpg'), os.path.join(root_path, 'KLE_0309_exp_sub6.jpg')], [os.path.join(root_path, 'KLE_0730_sub5.jpg'), os.path.join(root_path, 'KLE_0730_sub6.jpg')], [os.path.join(root_path, 'KLE_0747_sub5.jpg'), os.path.join(root_path, 'KLE_0747_sub6.jpg')], [os.path.join(root_path, 'KLE_9797clean_sub5.jpg'), os.path.join(root_path, 'KLE_9797clean_sub6.jpg')], [os.path.join(root_path, 'KLE_9803clean_sub5.jpg'), os.path.join(root_path, 'KLE_9803clean_sub6.jpg')], [os.path.join(root_path, 'NKM_0063_sub5.jpg'), os.path.join(root_path, 'NKM_0063_sub6.jpg')], [os.path.join(root_path, 'NKM_0109_sub5.jpg'), os.path.join(root_path, 'NKM_0109_sub6.jpg')], [os.path.join(root_path, 'scene_1_sub5.jpg'), os.path.join(root_path, 'scene_1_sub6.jpg')]])
    file_list['test'].extend([[os.path.join(root_path, 'KLE_0309_exp_sub5.jpg'), os.path.join(root_path, 'KLE_0309_exp_sub6.jpg')], [os.path.join(root_path, 'KLE_0730_sub5.jpg'), os.path.join(root_path, 'KLE_0730_sub6.jpg')], [os.path.join(root_path, 'KLE_0747_sub5.jpg'), os.path.join(root_path, 'KLE_0747_sub6.jpg')], [os.path.join(root_path, 'KLE_9797clean_sub5.jpg'), os.path.join(root_path, 'KLE_9797clean_sub6.jpg')], [os.path.join(root_path, 'KLE_9803clean_sub5.jpg'), os.path.join(root_path, 'KLE_9803clean_sub6.jpg')], [os.path.join(root_path, 'NKM_0063_sub5.jpg'), os.path.join(root_path, 'NKM_0063_sub6.jpg')], [os.path.join(root_path, 'NKM_0109_sub5.jpg'), os.path.join(root_path, 'NKM_0109_sub6.jpg')], [os.path.join(root_path, 'scene_1_sub5.jpg'), os.path.join(root_path, 'scene_1_sub6.jpg')]])
    file_list['train+valid'].extend([[os.path.join(root_path, 'KLE_0309_exp_sub5.jpg'), os.path.join(root_path, 'KLE_0309_exp_sub6.jpg')], [os.path.join(root_path, 'KLE_0730_sub5.jpg'), os.path.join(root_path, 'KLE_0730_sub6.jpg')], [os.path.join(root_path, 'KLE_0747_sub5.jpg'), os.path.join(root_path, 'KLE_0747_sub6.jpg')], [os.path.join(root_path, 'KLE_9797clean_sub5.jpg'), os.path.join(root_path, 'KLE_9797clean_sub6.jpg')], [os.path.join(root_path, 'KLE_9803clean_sub5.jpg'), os.path.join(root_path, 'KLE_9803clean_sub6.jpg')], [os.path.join(root_path, 'NKM_0063_sub5.jpg'), os.path.join(root_path, 'NKM_0063_sub6.jpg')], [os.path.join(root_path, 'NKM_0109_sub5.jpg'), os.path.join(root_path, 'NKM_0109_sub6.jpg')], [os.path.join(root_path, 'scene_1_sub5.jpg'), os.path.join(root_path, 'scene_1_sub6.jpg')]])
    self.dataset = file_list