(gt_path)
| 91 | return df |
| 92 | |
| 93 | def load_gt_depth(gt_path): |
| 94 | image_path = gt_path + "/images.txt" |
| 95 | image_df = load_image_data(image_path) |
| 96 | gt_depth, _ = load_matrix_from_bin(gt_path + "/depth_gt.bin") |
| 97 | |
| 98 | gt_depth = gt_depth[:,(0,1,2,4)] |
| 99 | |
| 100 | image_id_to_name = image_df.reset_index().set_index('IMAGE_ID')['NAME'] |
| 101 | |
| 102 | gt_depth_df = pd.DataFrame(gt_depth, columns=['IMAGE_ID', 'COORD1', 'COORD2', 'DEPTH']) |
| 103 | gt_depth_df['NAME'] = gt_depth_df['IMAGE_ID'].map(image_id_to_name) # 添加 NAME 列 |
| 104 | |
| 105 | grouped = gt_depth_df.groupby('NAME').apply( |
| 106 | lambda x: { |
| 107 | 'COORD1': x['COORD1'].to_numpy(), |
| 108 | 'COORD2': x['COORD2'].to_numpy(), |
| 109 | 'DEPTH': x['DEPTH'].to_numpy() |
| 110 | } |
| 111 | ) |
| 112 | return grouped |
| 113 | |
| 114 | |
| 115 | def load_colmap_gt(gt_path): |
nothing calls this directly
no test coverage detected