Spaces:
Runtime error
Runtime error
add function to display image and integrate it into the interface
Browse files- app.py +10 -1
- pioreactor.webp +0 -0
app.py
CHANGED
|
@@ -774,7 +774,10 @@ def get_data_default(time_scale, exp):
|
|
| 774 |
|
| 775 |
# Return both plots
|
| 776 |
return plot1, plot2, plot3, plot4
|
| 777 |
-
|
|
|
|
|
|
|
|
|
|
| 778 |
|
| 779 |
# Define the interface components
|
| 780 |
with gr.Blocks() as demo:
|
|
@@ -790,6 +793,12 @@ with gr.Blocks() as demo:
|
|
| 790 |
""")
|
| 791 |
gr.Markdown("This is a control panel for the Pioreactor. You can use this to control the Pioreactor. You can also view the status of the Pioreactor and view graphs of the data. To use a custom Pioreactor, click on the Custom tab.")
|
| 792 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 793 |
|
| 794 |
gr.Markdown("The experiment name is required for all commands. You can get the experiment name from the status tab. When changing experiments, remember to update the experiment name.")
|
| 795 |
experiment_input = gr.Textbox(label="Experiment", placeholder="Get Experiment Name From Status")
|
|
|
|
| 774 |
|
| 775 |
# Return both plots
|
| 776 |
return plot1, plot2, plot3, plot4
|
| 777 |
+
|
| 778 |
+
|
| 779 |
+
def show_image():
|
| 780 |
+
return "pioreactor.webp"
|
| 781 |
|
| 782 |
# Define the interface components
|
| 783 |
with gr.Blocks() as demo:
|
|
|
|
| 793 |
""")
|
| 794 |
gr.Markdown("This is a control panel for the Pioreactor. You can use this to control the Pioreactor. You can also view the status of the Pioreactor and view graphs of the data. To use a custom Pioreactor, click on the Custom tab.")
|
| 795 |
|
| 796 |
+
gr.Interface(
|
| 797 |
+
fn=show_image,
|
| 798 |
+
inputs=None,
|
| 799 |
+
outputs=gr.Image(type="filepath")
|
| 800 |
+
).launch()
|
| 801 |
+
|
| 802 |
|
| 803 |
gr.Markdown("The experiment name is required for all commands. You can get the experiment name from the status tab. When changing experiments, remember to update the experiment name.")
|
| 804 |
experiment_input = gr.Textbox(label="Experiment", placeholder="Get Experiment Name From Status")
|
pioreactor.webp
ADDED
|