Spaces:
Running
Running
fix gpu
Browse files
app.py
CHANGED
|
@@ -59,7 +59,7 @@ def get_dust3r_args_parser():
|
|
| 59 |
return parser
|
| 60 |
|
| 61 |
|
| 62 |
-
@spaces.GPU(duration=
|
| 63 |
def run_dust3r(inputfiles, input_path=None):
|
| 64 |
|
| 65 |
if input_path is not None:
|
|
@@ -154,7 +154,7 @@ def run_dust3r(inputfiles, input_path=None):
|
|
| 154 |
|
| 155 |
return outfile, feat_image_path, opt, None, None
|
| 156 |
|
| 157 |
-
@spaces.GPU(duration=
|
| 158 |
def run_feat2gs(opt, niter=2000):
|
| 159 |
|
| 160 |
if opt is None:
|
|
@@ -214,7 +214,7 @@ def run_feat2gs(opt, niter=2000):
|
|
| 214 |
except Exception as e:
|
| 215 |
raise gr.Error(f"Step 2 failed: {str(e)}")
|
| 216 |
|
| 217 |
-
@spaces.GPU(duration=
|
| 218 |
def run_render(opt, args, cam_traj='ellipse'):
|
| 219 |
if opt is None or args is None:
|
| 220 |
raise gr.Error("Please run Steps 1 and 2 first!")
|
|
@@ -249,15 +249,15 @@ def run_render(opt, args, cam_traj='ellipse'):
|
|
| 249 |
except Exception as e:
|
| 250 |
raise gr.Error(f"Step 3 failed: {str(e)}")
|
| 251 |
|
| 252 |
-
@spaces.GPU(duration=
|
| 253 |
-
def process_example(inputfiles, input_path):
|
| 254 |
-
|
| 255 |
|
| 256 |
-
|
| 257 |
|
| 258 |
-
|
| 259 |
|
| 260 |
-
|
| 261 |
|
| 262 |
def reset_dust3r_state():
|
| 263 |
return None, None, None, None, None
|
|
|
|
| 59 |
return parser
|
| 60 |
|
| 61 |
|
| 62 |
+
@spaces.GPU(duration=1000)
|
| 63 |
def run_dust3r(inputfiles, input_path=None):
|
| 64 |
|
| 65 |
if input_path is not None:
|
|
|
|
| 154 |
|
| 155 |
return outfile, feat_image_path, opt, None, None
|
| 156 |
|
| 157 |
+
@spaces.GPU(duration=1000)
|
| 158 |
def run_feat2gs(opt, niter=2000):
|
| 159 |
|
| 160 |
if opt is None:
|
|
|
|
| 214 |
except Exception as e:
|
| 215 |
raise gr.Error(f"Step 2 failed: {str(e)}")
|
| 216 |
|
| 217 |
+
@spaces.GPU(duration=1000)
|
| 218 |
def run_render(opt, args, cam_traj='ellipse'):
|
| 219 |
if opt is None or args is None:
|
| 220 |
raise gr.Error("Please run Steps 1 and 2 first!")
|
|
|
|
| 249 |
except Exception as e:
|
| 250 |
raise gr.Error(f"Step 3 failed: {str(e)}")
|
| 251 |
|
| 252 |
+
# @spaces.GPU(duration=1000)
|
| 253 |
+
# def process_example(inputfiles, input_path):
|
| 254 |
+
# dust3r_model, feat_image, dust3r_state, _, _ = run_dust3r(inputfiles, input_path=input_path)
|
| 255 |
|
| 256 |
+
# output_model, feat2gs_state, _ = run_feat2gs(dust3r_state, niter=2000)
|
| 257 |
|
| 258 |
+
# output_video = run_render(dust3r_state, feat2gs_state, cam_traj='interpolated')
|
| 259 |
|
| 260 |
+
# return dust3r_model, feat_image, output_model, output_video
|
| 261 |
|
| 262 |
def reset_dust3r_state():
|
| 263 |
return None, None, None, None, None
|