Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -51,10 +51,15 @@ iface = gr.Interface(
|
|
| 51 |
inputs=[
|
| 52 |
gr.Dropdown(choices=period_names.tolist(), label="Period 1"),
|
| 53 |
gr.Dropdown(choices=period_names.tolist(), label="Period 2"),
|
| 54 |
-
gr.Slider(0, 1, step=0.1, label="Interpolation"
|
| 55 |
],
|
| 56 |
outputs=gr.Image(label="Generated Image", height=218, width=178) # Set height and width as desired
|
| 57 |
)
|
| 58 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
if __name__ == "__main__":
|
| 60 |
iface.launch()
|
|
|
|
| 51 |
inputs=[
|
| 52 |
gr.Dropdown(choices=period_names.tolist(), label="Period 1"),
|
| 53 |
gr.Dropdown(choices=period_names.tolist(), label="Period 2"),
|
| 54 |
+
gr.Slider(0, 1, step=0.1, label="Interpolation")
|
| 55 |
],
|
| 56 |
outputs=gr.Image(label="Generated Image", height=218, width=178) # Set height and width as desired
|
| 57 |
)
|
| 58 |
|
| 59 |
+
def update_image(slider_value):
|
| 60 |
+
iface.outputs[0].set_value(generate_image(*iface.get_input_parameters()))
|
| 61 |
+
|
| 62 |
+
iface.inputs[-1].observe(update_image, names="value")
|
| 63 |
+
|
| 64 |
if __name__ == "__main__":
|
| 65 |
iface.launch()
|