zino36 commited on
Commit
3f08c79
1 Parent(s): 27d0c1d

Update mast3r/demo.py

Browse files
Files changed (1) hide show
  1. mast3r/demo.py +14 -2
mast3r/demo.py CHANGED
@@ -212,7 +212,14 @@ def set_scenegraph_options(inputfiles, win_cyclic, refid, scenegraph_type):
212
  refid = gradio.Slider(label="Scene Graph: Id", value=0, minimum=0,
213
  maximum=num_files - 1, step=1, visible=scenegraph_type == 'oneref')
214
  return win_col, winsize, win_cyclic, refid
215
-
 
 
 
 
 
 
 
216
  @spaces.GPU
217
  def recon_fun_decorator(tmpdirname, gradio_delete_cache, model, device,
218
  silent, image_size, *args, **kwargs):
@@ -224,7 +231,12 @@ def main_demo(tmpdirname, model, device, image_size, server_name, server_port, s
224
  share=False, gradio_delete_cache=False):
225
  if not silent:
226
  print('Outputing stuff in', tmpdirname)
227
-
 
 
 
 
 
228
  recon_fun = functools.partial(recon_fun_decorator, tmpdirname, gradio_delete_cache, model, device, silent, image_size)
229
  model_from_scene_fun = functools.partial(get_3D_model_from_scene, silent)
230
 
 
212
  refid = gradio.Slider(label="Scene Graph: Id", value=0, minimum=0,
213
  maximum=num_files - 1, step=1, visible=scenegraph_type == 'oneref')
214
  return win_col, winsize, win_cyclic, refid
215
+
216
+ gtmpdirname = None
217
+ ggradio_delete_cache = None
218
+ gmodel = None
219
+ gdevice = None
220
+ gsilent = None
221
+ gimage_size = None
222
+
223
  @spaces.GPU
224
  def recon_fun_decorator(tmpdirname, gradio_delete_cache, model, device,
225
  silent, image_size, *args, **kwargs):
 
231
  share=False, gradio_delete_cache=False):
232
  if not silent:
233
  print('Outputing stuff in', tmpdirname)
234
+ gtmpdirname = tmpdirname
235
+ ggradio_delete_cache = gradio_delete_cache
236
+ gmodel = model
237
+ gdevice = device
238
+ gsilent = silent
239
+ gimage_size = image_size
240
  recon_fun = functools.partial(recon_fun_decorator, tmpdirname, gradio_delete_cache, model, device, silent, image_size)
241
  model_from_scene_fun = functools.partial(get_3D_model_from_scene, silent)
242