Rawal Khirodkar commited on
Commit
a0097e1
·
1 Parent(s): 1a446df

Pointmap: expose .ply download in accordion

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -216,7 +216,7 @@ def predict(image: Image.Image, size: str, bg_mode: str):
216
  npy_path = tempfile.NamedTemporaryFile(delete=False, suffix=".npy").name
217
  np.save(npy_path, pointmap.astype(np.float32))
218
 
219
- return ply_path, npy_path
220
 
221
 
222
  # -----------------------------------------------------------------------------
@@ -311,9 +311,10 @@ with gr.Blocks(title="Sapiens2 Pointmap", theme=gr.themes.Soft(), css=CUSTOM_CSS
311
  gr.Examples(examples=EXAMPLES, inputs=inp, examples_per_page=14)
312
 
313
  with gr.Accordion("Raw Pointmap", open=False):
 
314
  out_npy = gr.File(label="Raw pointmap (.npy float32 [H, W, 3] in meters)")
315
 
316
- run.click(predict, inputs=[inp, size, bg], outputs=[out_ply, out_npy])
317
 
318
 
319
  if __name__ == "__main__":
 
216
  npy_path = tempfile.NamedTemporaryFile(delete=False, suffix=".npy").name
217
  np.save(npy_path, pointmap.astype(np.float32))
218
 
219
+ return ply_path, ply_path, npy_path
220
 
221
 
222
  # -----------------------------------------------------------------------------
 
311
  gr.Examples(examples=EXAMPLES, inputs=inp, examples_per_page=14)
312
 
313
  with gr.Accordion("Raw Pointmap", open=False):
314
+ out_ply_file = gr.File(label="Point cloud (.ply — open in MeshLab/CloudCompare/Blender)")
315
  out_npy = gr.File(label="Raw pointmap (.npy float32 [H, W, 3] in meters)")
316
 
317
+ run.click(predict, inputs=[inp, size, bg], outputs=[out_ply, out_ply_file, out_npy])
318
 
319
 
320
  if __name__ == "__main__":