daidedou commited on
Commit
36538fb
·
1 Parent(s): e3c8376

Try to fix the gpu aborted problem (duration?)

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -198,7 +198,7 @@ def init_clicked(mesh1_path, mesh2_path,
198
  p2p_init, _ = extract_p2p_torch_fmap(C12_obj, shape_dict["evecs"], target_dict["evecs"])
199
  return build_outputs(datadicts.shape_surf, datadicts.target_surf, datadicts.cmap1, p2p_init, tag="init")
200
 
201
- @spaces.GPU
202
  def run_clicked(mesh1_path, mesh2_path, yaml_path, lambda_val, zoomout_val, time_val, nloop_val, sds_val, proper_val, progress=gr.Progress(track_tqdm=True)):
203
  if not mesh1_path or not mesh2_path:
204
  raise gr.Error("Please upload both meshes.")
@@ -241,7 +241,8 @@ with gr.Blocks(title="DiffuMatch demo") as demo:
241
  <br/>
242
  Upload two meshes and try our ICCV zero-shot method <a href="https://daidedou.github.io/publication/nonrigiddiff">DiffuMatch</a> <br/>
243
  <b>Init</b> will give you a rough correspondence, and you can click on <b>Run</b> to see if our method is able to match the two shapes! <br/>
244
- <b>Recommended</b/>: The method requires that the meshes are aligned (rotation-wise) to work well. Also might not work with scans (but try it out!). <br/>
 
245
  """
246
  )
247
  with gr.Row():
@@ -267,7 +268,7 @@ with gr.Blocks(title="DiffuMatch demo") as demo:
267
  cache_examples=True
268
  )
269
 
270
- with gr.Accordion("Optional Settings", open=False):
271
  yaml_file = gr.File(label="Optional YAML config", file_types=[".yaml", ".yml"], visible=True)
272
 
273
  # except Exception:
@@ -285,7 +286,7 @@ with gr.Blocks(title="DiffuMatch demo") as demo:
285
  init_btn = gr.Button("Init", variant="primary")
286
  run_btn = gr.Button("Run", variant="secondary")
287
 
288
- gr.Markdown("### Outputs\nEach stage exports both **GLB** (preview below) and **PLY** (download links) with per‑vertex colors.")
289
  with gr.Tab("Init"):
290
  with gr.Row():
291
  init_view_a = gr.Model3D(label="Shape")
 
198
  p2p_init, _ = extract_p2p_torch_fmap(C12_obj, shape_dict["evecs"], target_dict["evecs"])
199
  return build_outputs(datadicts.shape_surf, datadicts.target_surf, datadicts.cmap1, p2p_init, tag="init")
200
 
201
+ @spaces.GPU(duration=120)
202
  def run_clicked(mesh1_path, mesh2_path, yaml_path, lambda_val, zoomout_val, time_val, nloop_val, sds_val, proper_val, progress=gr.Progress(track_tqdm=True)):
203
  if not mesh1_path or not mesh2_path:
204
  raise gr.Error("Please upload both meshes.")
 
241
  <br/>
242
  Upload two meshes and try our ICCV zero-shot method <a href="https://daidedou.github.io/publication/nonrigiddiff">DiffuMatch</a> <br/>
243
  <b>Init</b> will give you a rough correspondence, and you can click on <b>Run</b> to see if our method is able to match the two shapes! <br/>
244
+ <b>Recommended</b/>: The method requires that the meshes are aligned (rotation-wise) to work well.<br/>
245
+ This method might not work with topological inconsistencies, and will crash for methods with high number of vertices (>10000) - because of the preprocessing. Try it out and let us know! <br/>
246
  """
247
  )
248
  with gr.Row():
 
268
  cache_examples=True
269
  )
270
 
271
+ with gr.Accordion("Optional YAML full settings (see github to config)", open=False):
272
  yaml_file = gr.File(label="Optional YAML config", file_types=[".yaml", ".yml"], visible=True)
273
 
274
  # except Exception:
 
286
  init_btn = gr.Button("Init", variant="primary")
287
  run_btn = gr.Button("Run", variant="secondary")
288
 
289
+ gr.Markdown("### Outputs\n For both **Init** and **Run** stages, \n we provide a preview of the correspondences as coloreds glbs, \n and the obtained correspondence as a .txt file.")
290
  with gr.Tab("Init"):
291
  with gr.Row():
292
  init_view_a = gr.Model3D(label="Shape")