Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -50,10 +50,7 @@ app_ui = ui.page_fluid(
|
|
| 50 |
|
| 51 |
@module.ui
|
| 52 |
def plot_ui():
|
| 53 |
-
return ui.
|
| 54 |
-
ui.input_slider("opacity", "Opacity", 0, 1.0, 0.5),
|
| 55 |
-
ui.column(4, ui.output_plot("plot_prediction"))
|
| 56 |
-
)
|
| 57 |
|
| 58 |
@module.server
|
| 59 |
def plot_server(input, output, session, r):
|
|
@@ -139,8 +136,9 @@ def server(input, output, session: Session):
|
|
| 139 |
for idx, r in enumerate(results):
|
| 140 |
|
| 141 |
id = "image_" + str(idx)
|
|
|
|
| 142 |
|
| 143 |
-
plot_server(f"plot_{idx}", r=r)
|
| 144 |
|
| 145 |
ui_output.append(
|
| 146 |
ui.div(
|
|
@@ -148,6 +146,7 @@ def server(input, output, session: Session):
|
|
| 148 |
ui.column(4, ui.img(src=f"data:image/png;base64,{r['image_base64']}")),
|
| 149 |
plot_ui(f"plot_{idx}"),
|
| 150 |
),
|
|
|
|
| 151 |
ui.h5(r['filename'], style="margin-top: 15px;"),
|
| 152 |
ui.div(
|
| 153 |
ui.span(f"Viable = {r.get('viable', '? ')}", style="margin: 0 15px;"),
|
|
|
|
| 50 |
|
| 51 |
@module.ui
|
| 52 |
def plot_ui():
|
| 53 |
+
return ui.column(4, ui.output_plot("plot_prediction"))
|
|
|
|
|
|
|
|
|
|
| 54 |
|
| 55 |
@module.server
|
| 56 |
def plot_server(input, output, session, r):
|
|
|
|
| 136 |
for idx, r in enumerate(results):
|
| 137 |
|
| 138 |
id = "image_" + str(idx)
|
| 139 |
+
ui.input_slider(id, "Opacity", 0, 1.0, 0.5)
|
| 140 |
|
| 141 |
+
plot_server(f"plot_{idx}", r=r, input[id]())
|
| 142 |
|
| 143 |
ui_output.append(
|
| 144 |
ui.div(
|
|
|
|
| 146 |
ui.column(4, ui.img(src=f"data:image/png;base64,{r['image_base64']}")),
|
| 147 |
plot_ui(f"plot_{idx}"),
|
| 148 |
),
|
| 149 |
+
opacity,
|
| 150 |
ui.h5(r['filename'], style="margin-top: 15px;"),
|
| 151 |
ui.div(
|
| 152 |
ui.span(f"Viable = {r.get('viable', '? ')}", style="margin: 0 15px;"),
|