match_dict = associate.read_file_list(match_text) groundtruth_dict = associate.read_file_list(groundtruth_text) rgb_folder_full = dataset_root + rgb_folder depth_folder_full = dataset_root + depth_folder rgb_files = ListGenerator.get_files_from_directory(rgb_folder_full, delimiter='.') depth_files = ListGenerator.get_files_from_directory(depth_folder_full, delimiter='.') rgb_file_total = len(rgb_files) depth_file_total = len(depth_files) #image_groundtruth_dict = dict(associate.match(rgb_text, groundtruth_text,max_difference=0.2,with_duplicates=True)) image_groundtruth_dict = dict(associate.match(rgb_text, groundtruth_text)) #f1_d2 parameters = data_file.split('_') if data_file_2: parameters_2 = data_file_2.split('_') if data_file_3: parameters_3 = data_file_3.split('_') if data_file_4: parameters_4 = data_file_4.split('_') start_idx = float(parameters[0]) max_count = int(parameters[9]) offset = int(parameters[10]) #max_its = int(parameters[1]) #eps = float(parameters[2])
#bench_path = '/Users/marchaubenstock/Workspace/Diplomarbeit_Resources/rccar_15_11_18/' #bench_path = '/Users/marchaubenstock/Workspace/Diplomarbeit_Resources/rccar_26_09_18/' bench_path = '/Users/marchaubenstock/Workspace/Diplomarbeit_Resources/VO_Bench/' dataset = 'rgbd_dataset_freiburg2_desk/' #rgb_text = bench_path + dataset + 'rgb_rect.txt' #depth_text = bench_path + dataset + 'depth_large_rect_norm.txt' #match_file = bench_path + dataset + 'matches_rect_with_duplicates_norm.txt' rgb_text = bench_path + dataset + 'rgb.txt' depth_text = bench_path + dataset + 'accelerometer.txt' match_file = bench_path + dataset + 'accelerometer_rgb_matches.txt' with_duplicates_for_steering = True matches = associate.match(rgb_text,depth_text,with_duplicates=with_duplicates_for_steering,max_difference=0.2) try: os.remove(match_file) except OSError: pass with open(match_file, 'w') as f: f.write('# rgb_timestamp depth_timesamp\n') for (rgb_ts,depth_ts) in matches: rgb_ts_string = f'{rgb_ts:.9f}' depth_ts_string = f'{depth_ts:.9f}' f.write("%s %s\n" % (rgb_ts_string,depth_ts_string))
groundtruth_dict = associate.read_file_list(groundtruth_text) rgb_folder_full = dataset_root + rgb_folder depth_folder_full = dataset_root + depth_folder rgb_files = ListGenerator.get_files_from_directory(rgb_folder_full, delimiter='.') depth_files = ListGenerator.get_files_from_directory(depth_folder_full, delimiter='.') rgb_file_total = len(rgb_files) depth_file_total = len(depth_files) image_groundtruth_dict = dict( associate.match(rgb_text, groundtruth_text, with_duplicates=True, max_difference=0.3)) rgb_encoder_dict = associate.read_file_list(rgb_encoder_text) encoder_dict = associate.read_file_list(encoder_text) parameters = data_file.split('_') if data_file_2: parameters_2 = data_file_2.split('_') if data_file_3: parameters_3 = data_file_3.split('_') if data_file_4: parameters_4 = data_file_4.split('_') start_idx = float(parameters[0]) max_count = int(parameters[9]) offset = int(parameters[10])
+ '_' + f"{alpha_step}" \ + '_' + f"{image_range_offset_start}" \ + '_' + f"{use_ndc}" \ + '_' + f"{use_robust}" \ + '_' + f"{use_motion_prior}" \ + '_' + f"{use_ackermann}" \ + '_' + f"{max_count}" \ + '_' + f"{offset}" if additional_info: info += '_' + additional_info acceleration_list = [] match_dict = associate.read_file_list(match_text) image_groundtruth_dict = dict(associate.match(rgb_text, groundtruth_text, max_difference=0.2,with_duplicates=True)) rgb_acceleration_dict = associate.read_file_list(acceleration_match) acceleration_dict = associate.read_file_list(acceleration_text) post_process_gt = PostProcessGroundTruth.PostProcessTUM_F2() print(name+'_'+info+'\n') start = ListGenerator.get_index_of_id(start_idx,rgb_files) ref_id_list, target_id_list, ref_files_failed_to_load = ListGenerator.generate_files_to_load_match( rgb_files, start=start, max_count=max_count, offset=offset, ground_truth_dict=image_groundtruth_dict,
from Benchmark import associate import os bench_path = '/Users/marchaubenstock/Workspace/Diplomarbeit_Resources/VO_Bench/' xyz_dataset = 'rgbd_dataset_freiburg1_xyz/' rgb_folder = 'rgb/' depth_folder = 'depth/' rgb_text = bench_path+xyz_dataset+'rgb.txt' depth_text = bench_path+xyz_dataset+'depth.txt' matches = associate.match(rgb_text,depth_text) match_file = bench_path+xyz_dataset+'matches.txt' try: os.remove(match_file) except OSError: pass with open(match_file, 'w') as f: f.write('# rgb_timestamp depth_timestamp\n') for (rgb_ts,depth_ts) in matches: f.write("%s %s\n" % (rgb_ts,depth_ts))