Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -97,30 +97,27 @@ def server(input, output, session: Session):
|
|
| 97 |
return ui.div("No results yet. Upload images and click 'Analyze'.",
|
| 98 |
class_="text-muted")
|
| 99 |
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
ui.column(4, ui.img(src=f"data:image/png;base64,{r['image']}")),
|
| 104 |
-
# ui.column(4, ui.output_plot("output", result=r)),
|
| 105 |
-
),
|
| 106 |
-
ui.h5(r['filename'], style="margin-top: 15px;"),
|
| 107 |
ui.div(
|
| 108 |
-
ui.
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
|
|
|
| 122 |
|
| 123 |
-
|
| 124 |
|
| 125 |
@session.download()
|
| 126 |
def download():
|
|
|
|
| 97 |
return ui.div("No results yet. Upload images and click 'Analyze'.",
|
| 98 |
class_="text-muted")
|
| 99 |
|
| 100 |
+
output = []
|
| 101 |
+
for r in results:
|
| 102 |
+
output.append(
|
|
|
|
|
|
|
|
|
|
|
|
|
| 103 |
ui.div(
|
| 104 |
+
ui.row(
|
| 105 |
+
ui.column(4, ui.img(src=f"data:image/png;base64,{r['image']}")),
|
| 106 |
+
# ui.column(4, ui.output_plot("output", result=r)),
|
| 107 |
+
),
|
| 108 |
+
ui.h5(r['filename'], style="margin-top: 15px;"),
|
| 109 |
+
ui.div(
|
| 110 |
+
ui.span(f"Viable = {r.get('viable', '? ')}", style="margin: 0 15px;"),
|
| 111 |
+
ui.span(f"Nonviable = {r.get('non-viable', '? ')}", style="margin: 0 15px;"),
|
| 112 |
+
ui.span(f"Empty = {r.get('empty', '? ')}", style="margin: 0 15px;"),
|
| 113 |
+
ui.span(f"Total = {r.get('total', '? ')}", style="margin: 0 15px;"),
|
| 114 |
+
class_="results-text"
|
| 115 |
+
),
|
| 116 |
+
class_="card p-3"
|
| 117 |
+
)
|
| 118 |
+
)
|
| 119 |
|
| 120 |
+
return ui.div(output)
|
| 121 |
|
| 122 |
@session.download()
|
| 123 |
def download():
|