chrisjcc commited on
Commit
c63cdfe
·
verified ·
1 Parent(s): da9ef79

Update to hold fix simulation window size

Browse files
Files changed (1) hide show
  1. app.py +11 -2
app.py CHANGED
@@ -22,7 +22,10 @@ def simulate_and_render(seed: int, azimuth: float=35, elevation: float=-20, dist
22
  #)
23
 
24
  # Define the custom layout using Blocks
25
- with gr.Blocks() as iface:
 
 
 
26
  gr.Markdown("# TraySim Simulation Viewer")
27
  gr.Markdown("Simulates object drop on a tray using MuJoCo and shows the result as a GIF.")
28
 
@@ -37,7 +40,13 @@ with gr.Blocks() as iface:
37
 
38
  # Output column (70% width)
39
  with gr.Column(scale=7): # scale=7 for 70% width
40
- output_image = gr.Image(type="filepath", label="Simulation")
 
 
 
 
 
 
41
 
42
  # Connect the button to the simulation function
43
  submit_button.click(
 
22
  #)
23
 
24
  # Define the custom layout using Blocks
25
+ with gr.Blocks(
26
+ css="""#simulation_image {min-height: 600px; min-width: 700px;}""", # Set minimum size for the image
27
+ theme=gr.themes.Default()
28
+ ) as iface:
29
  gr.Markdown("# TraySim Simulation Viewer")
30
  gr.Markdown("Simulates object drop on a tray using MuJoCo and shows the result as a GIF.")
31
 
 
40
 
41
  # Output column (70% width)
42
  with gr.Column(scale=7): # scale=7 for 70% width
43
+ output_image = gr.Image(
44
+ type="filepath",
45
+ label="Simulation",
46
+ elem_id="simulation_image", # Assign an ID for CSS targeting
47
+ width=700, # Set default width
48
+ height=600 # Set default height
49
+ )
50
 
51
  # Connect the button to the simulation function
52
  submit_button.click(