Update app.py
Browse files
app.py
CHANGED
|
@@ -210,9 +210,9 @@ def change_textbox(choice):
|
|
| 210 |
|
| 211 |
def geometry_change(choice):
|
| 212 |
if choice == "Construct Shape from Parameters":
|
| 213 |
-
return [gradio.Radio.update(visible=True), gradio.Slider.update(visible=True), gradio.Slider.update(visible=True), gradio.Slider.update(visible=True), gradio.Slider.update(visible=True), gradio.Number.update(visible=False)]
|
| 214 |
elif choice == "Pick Shape from Dataset":
|
| 215 |
-
return [gradio.Radio.update(visible=False), gradio.Slider.update(visible=False), gradio.Slider.update(visible=False), gradio.Slider.update(visible=False), gradio.Slider.update(visible=False), gradio.Number.update(visible=True)]
|
| 216 |
|
| 217 |
with gradio.Blocks() as demo:
|
| 218 |
with gradio.Accordion("✨ Read about the ML model here! ✨", open=False):
|
|
@@ -241,7 +241,7 @@ with gradio.Blocks() as demo:
|
|
| 241 |
|
| 242 |
radio.change(fn=change_textbox, inputs=radio, outputs=[height, width, diameter, length])
|
| 243 |
num = gradio.Number(42, label="Type the index of the shape you would like to use or randomly select it.", visible=False)
|
| 244 |
-
|
| 245 |
btn1 = gradio.Button("Select")
|
| 246 |
with gradio.Column():
|
| 247 |
geo = gradio.Plot(label="Geometry")
|
|
@@ -256,6 +256,7 @@ with gradio.Blocks() as demo:
|
|
| 256 |
with gradio.Column():
|
| 257 |
true = gradio.Timeseries(x="Frequency", y=['Surge', 'Heave', 'Pitch'], label="True")
|
| 258 |
|
|
|
|
| 259 |
btn1.click(fn=geometry, inputs=[num], outputs=[geo])
|
| 260 |
btn2.click(fn=simple_analysis, inputs=[num], outputs=[pred, true])
|
| 261 |
|
|
|
|
| 210 |
|
| 211 |
def geometry_change(choice):
|
| 212 |
if choice == "Construct Shape from Parameters":
|
| 213 |
+
return [gradio.Radio.update(visible=True), gradio.Slider.update(visible=True), gradio.Slider.update(visible=True), gradio.Slider.update(visible=True), gradio.Slider.update(visible=True), gradio.Number.update(visible=False), gradio.Timeseries.update(visible=False)]
|
| 214 |
elif choice == "Pick Shape from Dataset":
|
| 215 |
+
return [gradio.Radio.update(visible=False), gradio.Slider.update(visible=False), gradio.Slider.update(visible=False), gradio.Slider.update(visible=False), gradio.Slider.update(visible=False), gradio.Number.update(visible=True), gradio.Timeseries.update(visible=True)]
|
| 216 |
|
| 217 |
with gradio.Blocks() as demo:
|
| 218 |
with gradio.Accordion("✨ Read about the ML model here! ✨", open=False):
|
|
|
|
| 241 |
|
| 242 |
radio.change(fn=change_textbox, inputs=radio, outputs=[height, width, diameter, length])
|
| 243 |
num = gradio.Number(42, label="Type the index of the shape you would like to use or randomly select it.", visible=False)
|
| 244 |
+
|
| 245 |
btn1 = gradio.Button("Select")
|
| 246 |
with gradio.Column():
|
| 247 |
geo = gradio.Plot(label="Geometry")
|
|
|
|
| 256 |
with gradio.Column():
|
| 257 |
true = gradio.Timeseries(x="Frequency", y=['Surge', 'Heave', 'Pitch'], label="True")
|
| 258 |
|
| 259 |
+
whence_commeth_geometry.change(fn=geometry_change, inputs=[whence_commeth_geometry], outputs=[radio, height, width, diameter, length, num, true])
|
| 260 |
btn1.click(fn=geometry, inputs=[num], outputs=[geo])
|
| 261 |
btn2.click(fn=simple_analysis, inputs=[num], outputs=[pred, true])
|
| 262 |
|