app.py
CHANGED
@@ -28,7 +28,7 @@ import matplotlib.pyplot as pl
|
|
28 |
from transformers import pipeline
|
29 |
from dust3r.utils.viz_demo import convert_scene_output_to_glb
|
30 |
import depth_pro
|
31 |
-
|
32 |
from huggingface_hub import hf_hub_download
|
33 |
pl.ion()
|
34 |
|
@@ -80,7 +80,8 @@ def get_3D_model_from_scene(outdir, silent, scene, min_conf_thr=3, as_pointcloud
|
|
80 |
return convert_scene_output_to_glb(outdir, rgbimg, pts3d, msk, focals, cams2world, as_pointcloud=as_pointcloud,
|
81 |
transparent_cams=transparent_cams, cam_size=cam_size, show_cam=show_cam, silent=silent, save_name=save_name,
|
82 |
cam_color=cam_color)
|
83 |
-
|
|
|
84 |
def generate_monocular_depth_maps(img_list, depth_prior_name):
|
85 |
depth_list = []
|
86 |
focallength_px_list = []
|
@@ -115,7 +116,7 @@ def generate_monocular_depth_maps(img_list, depth_prior_name):
|
|
115 |
#np.savez_compressed(path_depthanything, depth=depth)
|
116 |
return depth_list, focallength_px_list
|
117 |
|
118 |
-
|
119 |
def local_get_reconstructed_scene(filelist, min_conf_thr, as_pointcloud, mask_sky, clean_depth, transparent_cams, cam_size, depth_prior_name, **kw):
|
120 |
depth_list, focallength_px_list = generate_monocular_depth_maps(filelist, depth_prior_name)
|
121 |
imgs = load_images(filelist, depth_list, focallength_px_list, size=image_size, verbose=not silent,traj_format='custom', depth_prior_name=depth_prior_name)
|
|
|
28 |
from transformers import pipeline
|
29 |
from dust3r.utils.viz_demo import convert_scene_output_to_glb
|
30 |
import depth_pro
|
31 |
+
import spaces
|
32 |
from huggingface_hub import hf_hub_download
|
33 |
pl.ion()
|
34 |
|
|
|
80 |
return convert_scene_output_to_glb(outdir, rgbimg, pts3d, msk, focals, cams2world, as_pointcloud=as_pointcloud,
|
81 |
transparent_cams=transparent_cams, cam_size=cam_size, show_cam=show_cam, silent=silent, save_name=save_name,
|
82 |
cam_color=cam_color)
|
83 |
+
|
84 |
+
@spaces.GPU(duration=180)
|
85 |
def generate_monocular_depth_maps(img_list, depth_prior_name):
|
86 |
depth_list = []
|
87 |
focallength_px_list = []
|
|
|
116 |
#np.savez_compressed(path_depthanything, depth=depth)
|
117 |
return depth_list, focallength_px_list
|
118 |
|
119 |
+
@spaces.GPU(duration=180)
|
120 |
def local_get_reconstructed_scene(filelist, min_conf_thr, as_pointcloud, mask_sky, clean_depth, transparent_cams, cam_size, depth_prior_name, **kw):
|
121 |
depth_list, focallength_px_list = generate_monocular_depth_maps(filelist, depth_prior_name)
|
122 |
imgs = load_images(filelist, depth_list, focallength_px_list, size=image_size, verbose=not silent,traj_format='custom', depth_prior_name=depth_prior_name)
|