MCPcopy
hub / github.com/naver/dust3r / get_3D_model_from_scene

Function get_3D_model_from_scene

dust3r/demo.py:110–132  ·  view source on GitHub ↗

extract 3D_model (glb file) from a reconstructed scene

(outdir, silent, scene, min_conf_thr=3, as_pointcloud=False, mask_sky=False,
                            clean_depth=False, transparent_cams=False, cam_size=0.05)

Source from the content-addressed store, hash-verified

108
109
110def get_3D_model_from_scene(outdir, silent, scene, min_conf_thr=3, as_pointcloud=False, mask_sky=False,
111 clean_depth=False, transparent_cams=False, cam_size=0.05):
112 """
113 extract 3D_model (glb file) from a reconstructed scene
114 """
115 if scene is None:
116 return None
117 # post processes
118 if clean_depth:
119 scene = scene.clean_pointcloud()
120 if mask_sky:
121 scene = scene.mask_sky()
122
123 # get optimized values from scene
124 rgbimg = scene.imgs
125 focals = scene.get_focals().cpu()
126 cams2world = scene.get_im_poses().cpu()
127 # 3D pointcloud from depthmap, poses and intrinsics
128 pts3d = to_numpy(scene.get_pts3d())
129 scene.min_conf_thr = float(scene.conf_trf(torch.tensor(min_conf_thr)))
130 msk = to_numpy(scene.get_masks())
131 return _convert_scene_output_to_glb(outdir, rgbimg, pts3d, msk, focals, cams2world, as_pointcloud=as_pointcloud,
132 transparent_cams=transparent_cams, cam_size=cam_size, silent=silent)
133
134
135def get_reconstructed_scene(outdir, model, device, silent, image_size, filelist, schedule, niter, min_conf_thr,

Callers 1

get_reconstructed_sceneFunction · 0.85

Calls 8

to_numpyFunction · 0.90
clean_pointcloudMethod · 0.80
mask_skyMethod · 0.80
get_masksMethod · 0.80
get_focalsMethod · 0.45
get_im_posesMethod · 0.45
get_pts3dMethod · 0.45

Tested by

no test coverage detected