Add the camera's default values to the Gradio slider values
Browse files
app.py
CHANGED
|
@@ -4,7 +4,7 @@ os.environ["MUJOCO_GL"] = "osmesa" # or "egl" if you switch to EGL support
|
|
| 4 |
import gradio as gr
|
| 5 |
from tray_sim import run_tray_simulation
|
| 6 |
|
| 7 |
-
def simulate_and_render(seed: int, azimuth: float=
|
| 8 |
gif_path = run_tray_simulation(seed=seed, azimuth=azimuth, elevation=elevation, distance=distance)
|
| 9 |
return gif_path
|
| 10 |
|
|
@@ -12,9 +12,9 @@ iface = gr.Interface(
|
|
| 12 |
fn=simulate_and_render,
|
| 13 |
inputs=[
|
| 14 |
gr.Number(label="Random Seed", value=0),
|
| 15 |
-
gr.Slider(minimum=0, maximum=360, label="Azimuth", value=
|
| 16 |
-
gr.Slider(minimum=-90, maximum=90, label="Elevation", value=-
|
| 17 |
-
gr.Slider(minimum=0.2, maximum=1.0, label="Zoom (Distance)", value=0
|
| 18 |
],
|
| 19 |
outputs=gr.Image(type="filepath", label="Simulation"),
|
| 20 |
title="TraySim Simulation Viewer",
|
|
|
|
| 4 |
import gradio as gr
|
| 5 |
from tray_sim import run_tray_simulation
|
| 6 |
|
| 7 |
+
def simulate_and_render(seed: int, azimuth: float=35, elevation: float=-20, distance: float=1.0):
|
| 8 |
gif_path = run_tray_simulation(seed=seed, azimuth=azimuth, elevation=elevation, distance=distance)
|
| 9 |
return gif_path
|
| 10 |
|
|
|
|
| 12 |
fn=simulate_and_render,
|
| 13 |
inputs=[
|
| 14 |
gr.Number(label="Random Seed", value=0),
|
| 15 |
+
gr.Slider(minimum=0, maximum=360, label="Azimuth", value=35),
|
| 16 |
+
gr.Slider(minimum=-90, maximum=90, label="Elevation", value=-20),
|
| 17 |
+
gr.Slider(minimum=0.2, maximum=1.0, label="Zoom (Distance)", value=1.0)
|
| 18 |
],
|
| 19 |
outputs=gr.Image(type="filepath", label="Simulation"),
|
| 20 |
title="TraySim Simulation Viewer",
|