Update app.py
Browse files
app.py
CHANGED
|
@@ -7,15 +7,6 @@ import numpy
|
|
| 7 |
from tensorflow.python.framework.ops import disable_eager_execution
|
| 8 |
disable_eager_execution()
|
| 9 |
|
| 10 |
-
# Start a session for checking calculations and stuff
|
| 11 |
-
# import tensorflow as tf
|
| 12 |
-
# sess = tf.compat.v1.Session()
|
| 13 |
-
|
| 14 |
-
# from keras import backend as K
|
| 15 |
-
# K.set_session(sess)
|
| 16 |
-
|
| 17 |
-
# Do you want it loud?
|
| 18 |
-
# VERBOSE = 1
|
| 19 |
|
| 20 |
# This function loads a fuckton of data
|
| 21 |
def load_data():
|
|
@@ -217,6 +208,8 @@ def change_textbox(choice):
|
|
| 217 |
return [gradio.Slider.update(visible=True), gradio.Slider.update(visible=False), gradio.Slider.update(visible=True), gradio.Slider.update(visible=False)]
|
| 218 |
|
| 219 |
|
|
|
|
|
|
|
| 220 |
with gradio.Blocks() as demo:
|
| 221 |
with gradio.Accordion("✨ Read about the ML model here! ✨", open=False):
|
| 222 |
with gradio.Row():
|
|
@@ -227,13 +220,15 @@ with gradio.Blocks() as demo:
|
|
| 227 |
with gradio.Column():
|
| 228 |
download = gradio.HTML("<a href=\"https://huggingface.co/spaces/cmudrc/wecnet/resolve/main/McComb2019_Chapter_TowardTheRapidDesignOfEngineer.pdf\" style=\"width: 60%; display: block; margin: auto;\"><img src=\"https://huggingface.co/spaces/cmudrc/wecnet/resolve/main/coverpage.png\"></a>")
|
| 229 |
|
| 230 |
-
|
| 231 |
-
|
| 232 |
with gradio.Tab("Analysis"):
|
| 233 |
|
| 234 |
with gradio.Row():
|
| 235 |
-
with gradio.Column():
|
| 236 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 237 |
radio = gradio.Radio(
|
| 238 |
["box", "cone", "cylinder", "sphere", "wedge"], label="What kind of shape would you like to generate?", value="box"
|
| 239 |
)
|
|
@@ -243,7 +238,7 @@ with gradio.Blocks() as demo:
|
|
| 243 |
length = gradio.Slider(label="Length", interactive=True, minimum=3.0, maximum=10.0, value=6.5)
|
| 244 |
|
| 245 |
radio.change(fn=change_textbox, inputs=radio, outputs=[height, width, diameter, length])
|
| 246 |
-
with gradio.Accordion("Geometry from Dataset", open=False):
|
| 247 |
num = gradio.Number(42, label="data index")
|
| 248 |
btn1 = gradio.Button("Select")
|
| 249 |
|
|
|
|
| 7 |
from tensorflow.python.framework.ops import disable_eager_execution
|
| 8 |
disable_eager_execution()
|
| 9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
# This function loads a fuckton of data
|
| 12 |
def load_data():
|
|
|
|
| 208 |
return [gradio.Slider.update(visible=True), gradio.Slider.update(visible=False), gradio.Slider.update(visible=True), gradio.Slider.update(visible=False)]
|
| 209 |
|
| 210 |
|
| 211 |
+
|
| 212 |
+
|
| 213 |
with gradio.Blocks() as demo:
|
| 214 |
with gradio.Accordion("✨ Read about the ML model here! ✨", open=False):
|
| 215 |
with gradio.Row():
|
|
|
|
| 220 |
with gradio.Column():
|
| 221 |
download = gradio.HTML("<a href=\"https://huggingface.co/spaces/cmudrc/wecnet/resolve/main/McComb2019_Chapter_TowardTheRapidDesignOfEngineer.pdf\" style=\"width: 60%; display: block; margin: auto;\"><img src=\"https://huggingface.co/spaces/cmudrc/wecnet/resolve/main/coverpage.png\"></a>")
|
| 222 |
|
|
|
|
|
|
|
| 223 |
with gradio.Tab("Analysis"):
|
| 224 |
|
| 225 |
with gradio.Row():
|
| 226 |
+
with gradio.Column():
|
| 227 |
+
whence_commeth_geometry = gradio.Radio(
|
| 228 |
+
["Construct Shape from Parameters", "Pick Shape from Dataset"], label="How would you like to generate the shape of the offshore structure for analysis?", value="Construct Shape from Parameters"
|
| 229 |
+
)
|
| 230 |
+
# whence_commeth_geometry.change(fn=geometry_change, inputs=[whence_commeth_geometry], outputs=[asdfa, asdfb])
|
| 231 |
+
with gradio.Accordion("Geometry from Parameters", open=True) as asdfa:
|
| 232 |
radio = gradio.Radio(
|
| 233 |
["box", "cone", "cylinder", "sphere", "wedge"], label="What kind of shape would you like to generate?", value="box"
|
| 234 |
)
|
|
|
|
| 238 |
length = gradio.Slider(label="Length", interactive=True, minimum=3.0, maximum=10.0, value=6.5)
|
| 239 |
|
| 240 |
radio.change(fn=change_textbox, inputs=radio, outputs=[height, width, diameter, length])
|
| 241 |
+
with gradio.Accordion("Geometry from Dataset", open=False) as asdfb:
|
| 242 |
num = gradio.Number(42, label="data index")
|
| 243 |
btn1 = gradio.Button("Select")
|
| 244 |
|