ccm commited on
Commit
1c5bbca
·
1 Parent(s): 4435ed9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -32
app.py CHANGED
@@ -1360,38 +1360,26 @@ with gradio.Blocks() as demo:
1360
 
1361
  btn1.click(fn=randomize_analysis, inputs=[whence_commeth_geometry], outputs=[radio, length, height, width, diameter, num, geo])
1362
  btn2.click(fn=simple_analysis, inputs=[num, whence_commeth_geometry, radio, length, width, height, diameter], outputs=[pred, true])
1363
- with gradio.Tab("Synthesis"):
1364
- with gradio.Tab("Spectrum from Dataset"):
1365
-
1366
- with gradio.Row():
1367
- with gradio.Column():
1368
- num = gradio.Number(42, label="data index")
1369
- btn1 = gradio.Button("Select")
1370
- with gradio.Column():
1371
- perf = gradio.Timeseries(x="Frequency", y=['Surge', 'Heave', 'Pitch'], label="Performance")
1372
-
1373
- with gradio.Row():
1374
- btn2 = gradio.Button("Synthesize Geometry")
1375
-
1376
- with gradio.Row():
1377
- with gradio.Column():
1378
- pred = gradio.Plot(label="Predicted")
1379
-
1380
- with gradio.Column():
1381
- true = gradio.Plot(label="True")
1382
-
1383
- btn1.click(fn=performance, inputs=[num], outputs=[perf])
1384
- btn2.click(fn=simple_synthesis, inputs=[num], outputs=[pred, true])
1385
- with gradio.Tab("Spectrum from DataFrame"):
1386
- with gradio.Row():
1387
  perf = gradio.Timeseries(x="Frequency", y=['Surge', 'Heave', 'Pitch'], label="Performance")
1388
-
1389
- with gradio.Row():
1390
- btn2 = gradio.Button("Synthesize Geometry")
1391
-
1392
- with gradio.Row():
1393
- pred = gradio.Plot(label="Predicted")
1394
-
1395
- btn2.click(fn=synthesis_from_spectrum, inputs=[perf], outputs=[pred])
 
 
 
 
 
 
1396
 
1397
  demo.launch()
 
1360
 
1361
  btn1.click(fn=randomize_analysis, inputs=[whence_commeth_geometry], outputs=[radio, length, height, width, diameter, num, geo])
1362
  btn2.click(fn=simple_analysis, inputs=[num, whence_commeth_geometry, radio, length, width, height, diameter], outputs=[pred, true])
1363
+ with gradio.Tab("Synthesis"):
1364
+ with gradio.Row():
1365
+ with gradio.Column():
1366
+ num = gradio.Number(42, label="Type the index of the shape you would like to use or randomly select it.")
1367
+ btn1 = gradio.Button("Randomize")
1368
+ with gradio.Column():
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1369
  perf = gradio.Timeseries(x="Frequency", y=['Surge', 'Heave', 'Pitch'], label="Performance")
1370
+
1371
+ with gradio.Row():
1372
+ btn2 = gradio.Button("Synthesize Geometry")
1373
+
1374
+ with gradio.Row():
1375
+ with gradio.Column():
1376
+ pred = gradio.Plot(label="Predicted")
1377
+
1378
+ with gradio.Column():
1379
+ true = gradio.Plot(label="True")
1380
+
1381
+ btn1.click(fn=lambda: random.randint(1, 4999), inputs=[], outputs=num)
1382
+ num.chnage(fn=performance, inputs=[num], outputs=[perf])
1383
+ btn2.click(fn=simple_synthesis, inputs=[num], outputs=[pred, true])
1384
 
1385
  demo.launch()