MCPcopy Create free account
hub / github.com/ComputationalRobotics/XM-code / load_gt_depth

Function load_gt_depth

utils/readgt_colmap.py:93–112  ·  view source on GitHub ↗
(gt_path)

Source from the content-addressed store, hash-verified

91 return df
92
93def 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
115def load_colmap_gt(gt_path):

Callers

nothing calls this directly

Calls 2

load_matrix_from_binFunction · 0.90
load_image_dataFunction · 0.85

Tested by

no test coverage detected