tokenid commited on
Commit
74bd10c
1 Parent(s): fc6f56d
Files changed (1) hide show
  1. app.py +8 -4
app.py CHANGED
@@ -156,9 +156,7 @@ def run_pose_exploration_a(image1, image2, seed_value):
156
  matcher_ckpt_path=_matcher_ckpt_path_
157
  )
158
 
159
- fig = None
160
-
161
- return elevs, elev_ranges, fig
162
 
163
 
164
  @spaces.GPU
@@ -297,6 +295,8 @@ def run_demo():
297
  with gr.Column(min_width=280):
298
  processed_image2 = gr.Image(type='numpy', image_mode='RGB', label='Processed Image 2', width=280, interactive=False)
299
 
 
 
300
 
301
  with gr.Row():
302
  preprocess_chk = gr.Checkbox(True, label='Remove background and recenter object')
@@ -381,10 +381,14 @@ def run_demo():
381
  fn=run_preprocess,
382
  inputs=[input_image1, input_image2, preprocess_chk, seed_value],
383
  outputs=[processed_image1, processed_image2],
 
 
 
 
384
  ).success(
385
  fn=run_pose_exploration_a,
386
  inputs=[processed_image1, processed_image2, seed_value],
387
- outputs=[elevs, elev_ranges, vis_output]
388
  ).success(
389
  fn=partial(run_pose_exploration_b, cam_vis),
390
  inputs=[processed_image1, processed_image2, elevs, elev_ranges, probe_bsz, adj_bsz, adj_iters, seed_value],
 
156
  matcher_ckpt_path=_matcher_ckpt_path_
157
  )
158
 
159
+ return elevs, elev_ranges, gr.update(value='Preparation Done!')
 
 
160
 
161
 
162
  @spaces.GPU
 
295
  with gr.Column(min_width=280):
296
  processed_image2 = gr.Image(type='numpy', image_mode='RGB', label='Processed Image 2', width=280, interactive=False)
297
 
298
+ with gr.Row():
299
+ progress_info = gr.Markdown(None, visible=False)
300
 
301
  with gr.Row():
302
  preprocess_chk = gr.Checkbox(True, label='Remove background and recenter object')
 
381
  fn=run_preprocess,
382
  inputs=[input_image1, input_image2, preprocess_chk, seed_value],
383
  outputs=[processed_image1, processed_image2],
384
+ ).success(
385
+ fn=lambda: gr.update(value='Preparing Estimation...', visible=True),
386
+ inputs=[],
387
+ outputs=[progress_info]
388
  ).success(
389
  fn=run_pose_exploration_a,
390
  inputs=[processed_image1, processed_image2, seed_value],
391
+ outputs=[elevs, elev_ranges, progress_info]
392
  ).success(
393
  fn=partial(run_pose_exploration_b, cam_vis),
394
  inputs=[processed_image1, processed_image2, elevs, elev_ranges, probe_bsz, adj_bsz, adj_iters, seed_value],