Spaces:
Runtime error
Runtime error
Rawal Khirodkar commited on
Commit ·
fa5e6d1
1
Parent(s): c1ae985
Pointmap: re-layout (Input ↔ 3D in row1, controls ↔ Pointmap heatmap in row2); rename label
Browse files
app.py
CHANGED
|
@@ -395,27 +395,29 @@ HEADER_HTML = """
|
|
| 395 |
with gr.Blocks(title="Sapiens2 Pointmap", theme=gr.themes.Soft(), css=CUSTOM_CSS) as demo:
|
| 396 |
gr.HTML(HEADER_HTML)
|
| 397 |
|
| 398 |
-
|
|
|
|
| 399 |
inp = gr.Image(label="Input", type="pil", height=640, scale=2)
|
| 400 |
-
|
| 401 |
-
|
| 402 |
-
|
| 403 |
-
|
| 404 |
-
|
| 405 |
-
|
| 406 |
-
|
| 407 |
-
|
| 408 |
-
)
|
| 409 |
-
out_depth = gr.Image(label="Depth (Z)", type="pil", height=640)
|
| 410 |
-
|
| 411 |
-
with gr.Row():
|
| 412 |
-
size = gr.Radio(
|
| 413 |
-
choices=["0.4B"], # iteration mode — re-add other sizes when shipping
|
| 414 |
-
value=DEFAULT_SIZE,
|
| 415 |
-
label="Model",
|
| 416 |
-
scale=4,
|
| 417 |
)
|
| 418 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 419 |
|
| 420 |
gr.Examples(examples=EXAMPLES, inputs=inp, examples_per_page=14)
|
| 421 |
|
|
|
|
| 395 |
with gr.Blocks(title="Sapiens2 Pointmap", theme=gr.themes.Soft(), css=CUSTOM_CSS) as demo:
|
| 396 |
gr.HTML(HEADER_HTML)
|
| 397 |
|
| 398 |
+
# Row 1: input ↔ 3D mesh, equal height
|
| 399 |
+
with gr.Row(equal_height=True):
|
| 400 |
inp = gr.Image(label="Input", type="pil", height=640, scale=2)
|
| 401 |
+
out_glb = gr.Model3D(
|
| 402 |
+
label="3D mesh · drag to orbit · scroll to zoom · shift+drag to pan",
|
| 403 |
+
height=640,
|
| 404 |
+
clear_color=[0.10, 0.11, 0.14, 1.0],
|
| 405 |
+
camera_position=(35, 70, 4.0),
|
| 406 |
+
zoom_speed=0.7,
|
| 407 |
+
pan_speed=0.5,
|
| 408 |
+
scale=3,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 409 |
)
|
| 410 |
+
|
| 411 |
+
# Row 2: controls under the input, depth heatmap directly under the 3D mesh
|
| 412 |
+
with gr.Row(equal_height=True):
|
| 413 |
+
with gr.Column(scale=2):
|
| 414 |
+
size = gr.Radio(
|
| 415 |
+
choices=["0.4B"], # iteration mode — re-add other sizes when shipping
|
| 416 |
+
value=DEFAULT_SIZE,
|
| 417 |
+
label="Model",
|
| 418 |
+
)
|
| 419 |
+
run = gr.Button("Run", variant="primary", size="lg")
|
| 420 |
+
out_depth = gr.Image(label="Pointmap", type="pil", height=640, scale=3)
|
| 421 |
|
| 422 |
gr.Examples(examples=EXAMPLES, inputs=inp, examples_per_page=14)
|
| 423 |
|