MCPcopy Index your code
hub / github.com/Robbyant/lingbot-map / load

Method load

benchmark/viewer.py:153–189  ·  view source on GitHub ↗

Load cached scene data. Returns: Tuple of (trajectory_dict, point_clouds_list, is_aligned)

(self)

Source from the content-addressed store, hash-verified

151 return False
152
153 def load(self) -> tuple[Dict[str, np.ndarray], List[Dict[str, np.ndarray]], bool]:
154 """Load cached scene data.
155
156 Returns:
157 Tuple of (trajectory_dict, point_clouds_list, is_aligned)
158 """
159 try:
160 data = np.load(self.cache_file, allow_pickle=True)
161
162 # Load trajectory
163 traj_dict = {}
164 num_frames = int(data.get('num_frames', 0))
165 for i in range(num_frames):
166 if f'c2w_{i}' in data:
167 c2w = data[f'c2w_{i}']
168 traj_dict[i] = c2w
169
170 # Load point clouds
171 point_clouds = []
172 for i in range(num_frames):
173 pcd_dict = {}
174 if f'xyz_{i}' in data:
175 pcd_dict['xyz'] = data[f'xyz_{i}']
176 if f'rgb_{i}' in data:
177 pcd_dict['rgb'] = data[f'rgb_{i}']
178 point_clouds.append(pcd_dict)
179
180 # Load alignment status
181 with open(self.params_file, 'r') as f:
182 params = json.load(f)
183 is_aligned = params.get('is_aligned', False)
184
185 logger.info(f"Loaded {len(traj_dict)} poses and {len(point_clouds)} point clouds from cache (aligned={is_aligned})")
186 return traj_dict, point_clouds, is_aligned
187 except Exception as e:
188 logger.error(f"Failed to load cache: {e}")
189 return {}, [], False
190
191 def save(
192 self,

Callers 14

_rebuild_sceneMethod · 0.95
load_modelFunction · 0.45
is_validMethod · 0.45
is_valid_rgbMethod · 0.45
load_rgb_thumbnailsMethod · 0.45
load_sky_masksMethod · 0.45
read_metadataMethod · 0.45
load_evalMethod · 0.45
_save_eval_entryMethod · 0.45
read_sampling_jsonFunction · 0.45
_read_jsonMethod · 0.45
_load_modelMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected