def __init__(self, path_to_data, sigma=0, img_size=(480, 640), split='test', mvg_aug=False, align_flag=True): self.name = 'nogt' self.root = os.path.expanduser(path_to_data) self.split = 'test' self.files = collections.defaultdict(list) self.img_size = img_size self.perform_calib = True for split in ['test']: path = pjoin(self.root, split + '_list.txt') file_list = tuple(open(path, 'r')) file_list = [id_.rstrip() for id_ in file_list] self.files[split] = file_list self.len = len(self.files[self.split]) self.warp_by_flow = warp_by_flow(img_size[0], img_size[1], 1) flen = 520 #camparam[param_depth]['fx'] norm = plane_correction(flen, img_size, False) # norm = np.expand_dims(norm, 2) self.plane_correction = norm
def __init__(self, path_to_data, sigma=0, split='train', img_size=(480, 640), mvg_aug=True, align_flag=False): self.use_sigma = False if sigma > 0: self.use_sigma = True self.name = 'simtof' self.root = os.path.expanduser(path_to_data) self.split = split self.files = collections.defaultdict(list) self.img_size = img_size self.mvg_aug = mvg_aug self.align = align_flag ### set paths #### if self.align or self.mvg_aug: self.gt_path = 'gt_depth_rgb/' else: self.gt_path = 'gt_depth_rgb_small_pt/' ### end set paths ### for split in ['train', 'test']: path = pjoin(self.root, split + '_list.txt') file_list = tuple(open(path, 'r')) file_list = [id_.rstrip() for id_ in file_list] self.files[split] = file_list camparam = param_buffer(path_to_data + 'calib.bin') camparam = adjust_rotation(camparam, [1, 0, 0, 0, 1, 0, 0, 0, 1]) camparam = adjust_translation(camparam, [0, 0, 0]) camparam = adjust_distorsion(camparam, 0, 0) self.camparam = camparam rototrans_instance = RotoTransParam() self.avgrot = rototrans_instance.avgrot self.avgprpt = rototrans_instance.avgprpt self.avgtrans = rototrans_instance.avgtrans print(img_size) self.warp_by_flow = warp_by_flow(img_size[0], img_size[1], 1) norm = plane_correction(63.5, img_size) # norm = np.expand_dims(norm, 2) self.plane_correction = norm self.sigma = sigma self.len = len(self.files[self.split])
def __init__(self, path_to_data, sigma=0, split='train', img_size=(480, 640), mvg_aug=True, align_flag=False): self.use_sigma = False if sigma > 0: self.use_sigma = True, self.name = 'real' self.root = os.path.expanduser(path_to_data + 'RealData/vivo_data/test_vivo5/') self.split = split self.files = collections.defaultdict(list) self.img_size = img_size self.mvg_aug = mvg_aug self.align = align_flag for split in ['train', 'test']: path = pjoin(self.root, split + '_list.txt') file_list = tuple(open(path, 'r')) file_list = [id_.rstrip() for id_ in file_list] self.files[split] = file_list camparam = param_buffer_st(self.root + 'calib_verify.bin') camparam = adjust_rotation(camparam, [1, 0, 0, 0, 1, 0, 0, 0, 1]) camparam = adjust_translation(camparam, [0, 0, 0]) camparam = adjust_distorsion(camparam, 0, 0) self.path_to_data = path_to_data self.camparam = camparam rototrans_instance = RotoTransParam() self.avgrot = rototrans_instance.avgrot self.avgprpt = rototrans_instance.avgprpt self.avgtrans = rototrans_instance.avgtrans self.warp_by_flow = warp_by_flow(img_size[0], img_size[1], 1) flen = 520 #camparam[param_depth]['fx'] norm = plane_correction(flen, img_size, False) # norm = np.expand_dims(norm, 2) self.plane_correction = norm self.sigma = sigma self.len = len(self.files[self.split])