daidedou commited on
Commit
a69ca00
·
1 Parent(s): 9d4a372

Added examples (files now)

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -15,6 +15,7 @@ import os
15
  import io
16
  import time
17
  import json
 
18
  import tempfile
19
  from typing import Dict, Tuple, Optional
20
  from omegaconf import OmegaConf
@@ -250,9 +251,6 @@ with gr.Blocks(title="DiffuMatch demo") as demo:
250
  mesh2 = gr.File(label="Target Mesh (.ply, .off, .obj)", file_types=[".ply", ".off", ".obj"])
251
  mesh2_viewer = gr.Model3D(label="Preview Target")
252
  mesh2.upload(fn=convert_and_show, inputs=mesh2, outputs=mesh2_viewer)
253
-
254
- yaml_file = gr.File(label="Optional YAML config", file_types=[".yaml", ".yml"], visible=True)
255
-
256
  gr.Examples(
257
  examples=[
258
  ["examples/man.ply", "examples/woman.ply"],
@@ -266,6 +264,9 @@ with gr.Blocks(title="DiffuMatch demo") as demo:
266
  cache_examples=True
267
  )
268
 
 
 
 
269
  # except Exception:
270
  with gr.Accordion("Settings", open=True):
271
  with gr.Row():
@@ -318,6 +319,7 @@ if __name__ == "__main__":
318
  print("Making matcher")
319
  matcher = zero_shot.Matcher(cfg)
320
  print("Matcher ready")
 
321
  os.makedirs("tmp", exist_ok=True)
322
  datadicts = None
323
  demo.launch(share=args.share)
 
15
  import io
16
  import time
17
  import json
18
+ import shutil
19
  import tempfile
20
  from typing import Dict, Tuple, Optional
21
  from omegaconf import OmegaConf
 
251
  mesh2 = gr.File(label="Target Mesh (.ply, .off, .obj)", file_types=[".ply", ".off", ".obj"])
252
  mesh2_viewer = gr.Model3D(label="Preview Target")
253
  mesh2.upload(fn=convert_and_show, inputs=mesh2, outputs=mesh2_viewer)
 
 
 
254
  gr.Examples(
255
  examples=[
256
  ["examples/man.ply", "examples/woman.ply"],
 
264
  cache_examples=True
265
  )
266
 
267
+ with gr.Accordion("Optional Settings", open=False):
268
+ yaml_file = gr.File(label="Optional YAML config", file_types=[".yaml", ".yml"], visible=True)
269
+
270
  # except Exception:
271
  with gr.Accordion("Settings", open=True):
272
  with gr.Row():
 
319
  print("Making matcher")
320
  matcher = zero_shot.Matcher(cfg)
321
  print("Matcher ready")
322
+ shutil.rmtree("tmp")
323
  os.makedirs("tmp", exist_ok=True)
324
  datadicts = None
325
  demo.launch(share=args.share)