Spaces:
Sleeping
Sleeping
Improved history tab
Browse files- app.py +5 -5
- homepage.md +1 -1
app.py
CHANGED
@@ -68,7 +68,7 @@ def classify(image: np.array, history):
|
|
68 |
detail = fetch_data(p.item())
|
69 |
pred = gr.Markdown(detail.result_text())
|
70 |
|
71 |
-
history += [(resize_image(image), detail.name)]
|
72 |
hist = history[-MAX_HISTORY:]
|
73 |
|
74 |
return pred, *ratios, *toggle_history_components(hist), history
|
@@ -140,15 +140,15 @@ def history_tab():
|
|
140 |
history_names = []
|
141 |
with gr.Row():
|
142 |
gr.Markdown("# Image")
|
143 |
-
gr.
|
144 |
-
|
145 |
|
146 |
with gr.Column():
|
147 |
for _ in range(MAX_HISTORY):
|
148 |
with gr.Row():
|
149 |
history_imgs.append(gr.Image(height=200,visible=False))
|
150 |
-
|
151 |
-
|
152 |
|
153 |
return history_imgs + history_names
|
154 |
|
|
|
68 |
detail = fetch_data(p.item())
|
69 |
pred = gr.Markdown(detail.result_text())
|
70 |
|
71 |
+
history += [(resize_image(image), f"<h2>{detail.name}</h2> \n {detail.desc}")]
|
72 |
hist = history[-MAX_HISTORY:]
|
73 |
|
74 |
return pred, *ratios, *toggle_history_components(hist), history
|
|
|
140 |
history_names = []
|
141 |
with gr.Row():
|
142 |
gr.Markdown("# Image")
|
143 |
+
with gr.Column(scale=2):
|
144 |
+
gr.Markdown("# Species")
|
145 |
|
146 |
with gr.Column():
|
147 |
for _ in range(MAX_HISTORY):
|
148 |
with gr.Row():
|
149 |
history_imgs.append(gr.Image(height=200,visible=False))
|
150 |
+
with gr.Column(scale=2):
|
151 |
+
history_names.append(gr.Markdown("",visible=False))
|
152 |
|
153 |
return history_imgs + history_names
|
154 |
|
homepage.md
CHANGED
@@ -17,7 +17,7 @@ Simply go the the "Samples" tab, choose a species from the dropdown, and select
|
|
17 |
### Classification Output
|
18 |
After classification has completed, the predictions results will be shown. The header will be the main predictions. There will also be a dropdown, containing more details of the species. Note some species are more well documented than others, so the length of the details will vary greatly.
|
19 |
|
20 |
-
Below that are the confidence scores of the prediction, arranged in a
|
21 |
|
22 |
### Prediction History
|
23 |
In the "History" tab, the results of previous predictions will be displayed, with the image uploaded and the species predicted.
|
|
|
17 |
### Classification Output
|
18 |
After classification has completed, the predictions results will be shown. The header will be the main predictions. There will also be a dropdown, containing more details of the species. Note some species are more well documented than others, so the length of the details will vary greatly.
|
19 |
|
20 |
+
Below that are the confidence scores of the prediction, arranged in a descending order
|
21 |
|
22 |
### Prediction History
|
23 |
In the "History" tab, the results of previous predictions will be displayed, with the image uploaded and the species predicted.
|