lemonaddie commited on
Commit
80f2b7b
1 Parent(s): a0b7d84

Update app_recon.py

Browse files
Files changed (1) hide show
  1. app_recon.py +9 -4
app_recon.py CHANGED
@@ -172,9 +172,9 @@ def reconstruction(image, files):
172
 
173
  normal_np[:, :, 0] *= -1
174
  _, 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)
175
- ply_path = os.path.join(dir_name, f"{name_base}_mask.ply")
176
  surface.save(ply_path, binary=False)
177
- return ply_path
178
 
179
  def run_demo():
180
 
@@ -271,8 +271,13 @@ def run_demo():
271
  recon_btn = gr.Button('Is there a salient foreground object? If yes, Click here to Reconstruct its 3D model.', variant='primary', interactive=True)
272
 
273
  with gr.Row():
274
- reconstructed_3d = gr.Model3D(
275
- label = 'Bini post-processed 3D model', height=320, interactive=False,
 
 
 
 
 
276
  )
277
 
278
 
 
172
 
173
  normal_np[:, :, 0] *= -1
174
  _, 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)
175
+ ply_path = os.path.join(dir_name, f"{name_base}_recon.ply")
176
  surface.save(ply_path, binary=False)
177
+ return [ply_path]
178
 
179
  def run_demo():
180
 
 
271
  recon_btn = gr.Button('Is there a salient foreground object? If yes, Click here to Reconstruct its 3D model.', variant='primary', interactive=True)
272
 
273
  with gr.Row():
274
+ # reconstructed_3d = gr.Model3D(
275
+ # label = 'Bini post-processed 3D model', height=320, interactive=False,
276
+ # )
277
+ reconstructed_3d = gr.Files(
278
+ label = "Bini post-processed 3D model (plyfile)",
279
+ elem_id = "download",
280
+ interactive=False,
281
  )
282
 
283