Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -101,7 +101,7 @@ def server(input, output, session: Session):
|
|
| 101 |
return ui.div("No results yet. Upload images and click 'Analyze'.",
|
| 102 |
class_="text-muted")
|
| 103 |
|
| 104 |
-
|
| 105 |
for i, r in enumerate(results):
|
| 106 |
|
| 107 |
id = "image_" + str(i)
|
|
@@ -110,7 +110,7 @@ def server(input, output, session: Session):
|
|
| 110 |
plot_name = f"plot_{i}"
|
| 111 |
output(create_plot(r), id=plot_name)
|
| 112 |
|
| 113 |
-
|
| 114 |
ui.div(
|
| 115 |
ui.row(
|
| 116 |
ui.column(4, ui.img(src=f"data:image/png;base64,{r['image_base64']}")),
|
|
@@ -128,7 +128,7 @@ def server(input, output, session: Session):
|
|
| 128 |
class_="card p-3"
|
| 129 |
)
|
| 130 |
)
|
| 131 |
-
return ui.div(
|
| 132 |
|
| 133 |
def create_plot(r):
|
| 134 |
@render.plot
|
|
|
|
| 101 |
return ui.div("No results yet. Upload images and click 'Analyze'.",
|
| 102 |
class_="text-muted")
|
| 103 |
|
| 104 |
+
ui_output = []
|
| 105 |
for i, r in enumerate(results):
|
| 106 |
|
| 107 |
id = "image_" + str(i)
|
|
|
|
| 110 |
plot_name = f"plot_{i}"
|
| 111 |
output(create_plot(r), id=plot_name)
|
| 112 |
|
| 113 |
+
ui_output.append(
|
| 114 |
ui.div(
|
| 115 |
ui.row(
|
| 116 |
ui.column(4, ui.img(src=f"data:image/png;base64,{r['image_base64']}")),
|
|
|
|
| 128 |
class_="card p-3"
|
| 129 |
)
|
| 130 |
)
|
| 131 |
+
return ui.div(ui_output)
|
| 132 |
|
| 133 |
def create_plot(r):
|
| 134 |
@render.plot
|