fffiloni commited on
Commit
bb4b123
·
verified ·
1 Parent(s): 2ef5adb

add tqdm progress + mesh input visualizer

Browse files
Files changed (1) hide show
  1. app.py +10 -1
app.py CHANGED
@@ -113,7 +113,7 @@ def explode_mesh(mesh: trimesh.Scene, explode_factor: float = 0.5):
113
 
114
 
115
  @spaces.GPU(duration=600)
116
- def run_full(data_path, seed=42, num_inference_steps=25, guidance_scale=3.5):
117
 
118
  batch_size = 30
119
  parts_data = prepare_data(data_path)
@@ -142,6 +142,9 @@ def run_full(data_path, seed=42, num_inference_steps=25, guidance_scale=3.5):
142
 
143
  return mesh_path, exploded_mesh_path
144
 
 
 
 
145
 
146
  @spaces.GPU(duration=600)
147
  def run_example(data_path: str, example_image_path, seed=42, num_inference_steps=25, guidance_scale=3.5):
@@ -233,6 +236,12 @@ with gr.Blocks(title="HoloPart") as demo:
233
  """
234
 
235
 
 
 
 
 
 
 
236
 
237
  gen_button.click(
238
  run_full,
 
113
 
114
 
115
  @spaces.GPU(duration=600)
116
+ def run_full(data_path, seed=42, num_inference_steps=25, guidance_scale=3.5, progress=gr.Progress(track_tqdm=True)):
117
 
118
  batch_size = 30
119
  parts_data = prepare_data(data_path)
 
142
 
143
  return mesh_path, exploded_mesh_path
144
 
145
+ def visualize_input(mesh_in):
146
+ return mesh_in
147
+
148
 
149
  @spaces.GPU(duration=600)
150
  def run_example(data_path: str, example_image_path, seed=42, num_inference_steps=25, guidance_scale=3.5):
 
236
  """
237
 
238
 
239
+ input_mesh.upload(
240
+ fn = visualize_input,
241
+ inputs = [input_mesh],
242
+ outputs = [input_visualizer],
243
+ queue=False
244
+ )
245
 
246
  gen_button.click(
247
  run_full,