Spaces:
Running on Zero
Running on Zero
Rawal Khirodkar commited on
Commit ·
9705303
1
Parent(s): a0097e1
Pointmap: drop .npy download, only offer .ply
Browse files
app.py
CHANGED
|
@@ -213,10 +213,7 @@ def predict(image: Image.Image, size: str, bg_mode: str):
|
|
| 213 |
mask = _foreground_mask(image_pil, h0, w0) if bg_mode == "fg-bg" else None
|
| 214 |
ply_path = _make_ply(image_rgb, pointmap, mask)
|
| 215 |
|
| 216 |
-
|
| 217 |
-
np.save(npy_path, pointmap.astype(np.float32))
|
| 218 |
-
|
| 219 |
-
return ply_path, ply_path, npy_path
|
| 220 |
|
| 221 |
|
| 222 |
# -----------------------------------------------------------------------------
|
|
@@ -312,9 +309,8 @@ with gr.Blocks(title="Sapiens2 Pointmap", theme=gr.themes.Soft(), css=CUSTOM_CSS
|
|
| 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
|
| 318 |
|
| 319 |
|
| 320 |
if __name__ == "__main__":
|
|
|
|
| 213 |
mask = _foreground_mask(image_pil, h0, w0) if bg_mode == "fg-bg" else None
|
| 214 |
ply_path = _make_ply(image_rgb, pointmap, mask)
|
| 215 |
|
| 216 |
+
return ply_path, ply_path
|
|
|
|
|
|
|
|
|
|
| 217 |
|
| 218 |
|
| 219 |
# -----------------------------------------------------------------------------
|
|
|
|
| 309 |
|
| 310 |
with gr.Accordion("Raw Pointmap", open=False):
|
| 311 |
out_ply_file = gr.File(label="Point cloud (.ply — open in MeshLab/CloudCompare/Blender)")
|
|
|
|
| 312 |
|
| 313 |
+
run.click(predict, inputs=[inp, size, bg], outputs=[out_ply, out_ply_file])
|
| 314 |
|
| 315 |
|
| 316 |
if __name__ == "__main__":
|