Spaces:
Running on Zero
Running on Zero
Rawal Khirodkar commited on
Commit ·
c43d03d
1
Parent(s): ff46806
Normal: drop full-res image preview, keep only .npy download
Browse files
app.py
CHANGED
|
@@ -179,7 +179,7 @@ def predict(image: Image.Image, size: str, bg_mode: str):
|
|
| 179 |
np.save(npy_path, raw.astype(np.float32))
|
| 180 |
|
| 181 |
# Slider value: (left_image, right_image) — left=input RGB, right=normal map.
|
| 182 |
-
return (image_pil, rgb_pil),
|
| 183 |
|
| 184 |
|
| 185 |
# -----------------------------------------------------------------------------
|
|
@@ -272,11 +272,10 @@ with gr.Blocks(title="Sapiens2 Normal", theme=gr.themes.Soft(), css=CUSTOM_CSS)
|
|
| 272 |
|
| 273 |
gr.Examples(examples=EXAMPLES, inputs=inp, examples_per_page=14)
|
| 274 |
|
| 275 |
-
with gr.Accordion("
|
| 276 |
-
out_img_full = gr.Image(label="Normal (original resolution)", type="pil")
|
| 277 |
out_npy = gr.File(label="Raw normals (.npy float32 [-1, 1]; NaN where bg removed)")
|
| 278 |
|
| 279 |
-
run.click(predict, inputs=[inp, size, bg], outputs=[out_img,
|
| 280 |
|
| 281 |
|
| 282 |
if __name__ == "__main__":
|
|
|
|
| 179 |
np.save(npy_path, raw.astype(np.float32))
|
| 180 |
|
| 181 |
# Slider value: (left_image, right_image) — left=input RGB, right=normal map.
|
| 182 |
+
return (image_pil, rgb_pil), npy_path
|
| 183 |
|
| 184 |
|
| 185 |
# -----------------------------------------------------------------------------
|
|
|
|
| 272 |
|
| 273 |
gr.Examples(examples=EXAMPLES, inputs=inp, examples_per_page=14)
|
| 274 |
|
| 275 |
+
with gr.Accordion("Raw Normals", open=False):
|
|
|
|
| 276 |
out_npy = gr.File(label="Raw normals (.npy float32 [-1, 1]; NaN where bg removed)")
|
| 277 |
|
| 278 |
+
run.click(predict, inputs=[inp, size, bg], outputs=[out_img, out_npy])
|
| 279 |
|
| 280 |
|
| 281 |
if __name__ == "__main__":
|