lemonaddie commited on
Commit
d9624e5
1 Parent(s): 4cc4f56

Update app_recon.py

Browse files
Files changed (1) hide show
  1. app_recon.py +12 -9
app_recon.py CHANGED
@@ -181,7 +181,7 @@ def reconstruction(image, files):
181
  _, surface, _, _, _ = bilateral_normal_integration_function(normal_np, mask_output_temp, k=2, K=None, max_iter=100, tol=1e-4, cg_max_iter=5000, cg_tol=1e-3)
182
  ply_path = os.path.join(dir_name, f"{name_base}_recon.ply")
183
  surface.save(ply_path, binary=False)
184
- return [ply_path]
185
 
186
  def run_demo():
187
 
@@ -278,14 +278,17 @@ def run_demo():
278
  recon_btn = gr.Button('Is there a salient foreground object? If yes, Click here to Reconstruct its 3D model.', variant='primary', interactive=True)
279
 
280
  with gr.Row():
281
- # reconstructed_3d = gr.Model3D(
282
- # label = 'Bini post-processed 3D model', height=320, interactive=False,
 
 
 
 
 
 
 
 
283
  # )
284
- reconstructed_3d = gr.Files(
285
- label = "Bini post-processed 3D model (plyfile)",
286
- elem_id = "download",
287
- interactive=False,
288
- )
289
 
290
 
291
  run_btn.click(fn=depth_normal,
@@ -298,7 +301,7 @@ def run_demo():
298
  )
299
  recon_btn.click(fn=reconstruction,
300
  inputs=[input_image, files],
301
- outputs=[reconstructed_3d]
302
  )
303
  demo.queue().launch(share=True, max_threads=80)
304
 
 
181
  _, surface, _, _, _ = bilateral_normal_integration_function(normal_np, mask_output_temp, k=2, K=None, max_iter=100, tol=1e-4, cg_max_iter=5000, cg_tol=1e-3)
182
  ply_path = os.path.join(dir_name, f"{name_base}_recon.ply")
183
  surface.save(ply_path, binary=False)
184
+ return [ply_path], masked_image
185
 
186
  def run_demo():
187
 
 
278
  recon_btn = gr.Button('Is there a salient foreground object? If yes, Click here to Reconstruct its 3D model.', variant='primary', interactive=True)
279
 
280
  with gr.Row():
281
+ gr.Column():
282
+ masked_image = gr.Image(interactive=False, label="Masked foreground.")
283
+ gr.Column():
284
+ reconstructed_3d = gr.Model3D(
285
+ label = 'Bini post-processed 3D model', height=320, interactive=False,
286
+ )
287
+ # reconstructed_3d = gr.Files(
288
+ # label = "Bini post-processed 3D model (plyfile)",
289
+ # elem_id = "download",
290
+ # interactive=False,
291
  # )
 
 
 
 
 
292
 
293
 
294
  run_btn.click(fn=depth_normal,
 
301
  )
302
  recon_btn.click(fn=reconstruction,
303
  inputs=[input_image, files],
304
+ outputs=[reconstructed_3d, masked_image]
305
  )
306
  demo.queue().launch(share=True, max_threads=80)
307