Skip to content

Commit 3d56b6b

Browse files
authored
Avoid using np allow_pickle for Deserialization
1 parent b017d60 commit 3d56b6b

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

demo_gradio.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,9 +288,22 @@ def update_visualization(
288288
if not os.path.exists(predictions_path):
289289
return None, f"No reconstruction available at {predictions_path}. Please run 'Reconstruct' first."
290290

291-
loaded = np.load(predictions_path, allow_pickle=True)
292-
predictions = {key: loaded[key] for key in loaded.keys()}
291+
key_list = [
292+
'pose_enc',
293+
'depth',
294+
'depth_conf',
295+
'world_points',
296+
'world_points_conf',
297+
'images',
298+
'extrinsic',
299+
'intrinsic',
300+
'world_points_from_depth',
301+
]
302+
303+
loaded = np.load(predictions_path)
304+
predictions = {key: np.array(loaded[key]) for key in key_list}
293305

306+
294307
glbfile = os.path.join(
295308
target_dir,
296309
f"glbscene_{conf_thres}_{frame_filter.replace('.', '_').replace(':', '').replace(' ', '_')}_maskb{mask_black_bg}_maskw{mask_white_bg}_cam{show_cam}_sky{mask_sky}_pred{prediction_mode.replace(' ', '_')}.glb",

0 commit comments

Comments
 (0)