Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -101,13 +101,18 @@ def server(input, output, session: Session):
|
|
| 101 |
|
| 102 |
output = []
|
| 103 |
for r in results:
|
| 104 |
-
|
| 105 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 106 |
output.append(
|
| 107 |
ui.div(
|
| 108 |
ui.row(
|
| 109 |
ui.column(4, ui.img(src=f"data:image/png;base64,{r['image_base64']}")),
|
| 110 |
-
ui.column(4, ui.output_plot(
|
| 111 |
),
|
| 112 |
ui.h5(r['filename'], style="margin-top: 15px;"),
|
| 113 |
ui.div(
|
|
@@ -120,8 +125,7 @@ def server(input, output, session: Session):
|
|
| 120 |
class_="card p-3"
|
| 121 |
)
|
| 122 |
)
|
| 123 |
-
|
| 124 |
-
return ui.div(output)
|
| 125 |
|
| 126 |
@session.download()
|
| 127 |
def download():
|
|
|
|
| 101 |
|
| 102 |
output = []
|
| 103 |
for r in results:
|
| 104 |
+
|
| 105 |
+
@render.plot
|
| 106 |
+
def plot_predicitons():
|
| 107 |
+
fig, ax = plt.subplots()
|
| 108 |
+
plt.imshow(r["image"])
|
| 109 |
+
return fig
|
| 110 |
+
|
| 111 |
output.append(
|
| 112 |
ui.div(
|
| 113 |
ui.row(
|
| 114 |
ui.column(4, ui.img(src=f"data:image/png;base64,{r['image_base64']}")),
|
| 115 |
+
ui.column(4, ui.output_plot("plot_predicitons")),
|
| 116 |
),
|
| 117 |
ui.h5(r['filename'], style="margin-top: 15px;"),
|
| 118 |
ui.div(
|
|
|
|
| 125 |
class_="card p-3"
|
| 126 |
)
|
| 127 |
)
|
| 128 |
+
return ui.div(output)
|
|
|
|
| 129 |
|
| 130 |
@session.download()
|
| 131 |
def download():
|