data
Browse files
app.py
CHANGED
@@ -111,7 +111,7 @@ def thresh_fn(val):
|
|
111 |
|
112 |
rgba_img = cmap(preds)
|
113 |
rgb_img = np.delete(rgba_img, 3, 2)
|
114 |
-
return rgb_img
|
115 |
|
116 |
with gr.Blocks() as demo:
|
117 |
gr.Markdown(
|
@@ -122,6 +122,7 @@ with gr.Blocks() as demo:
|
|
122 |
with gr.Row():
|
123 |
inp = gr.Dropdown(label="Taxonomic Hierarchy", choices=["Class", "Order", "Family", "Genus", "Species"])
|
124 |
out = gr.Dropdown(label="Name", interactive=True)
|
|
|
125 |
inp.change(update_fn, inp, out)
|
126 |
|
127 |
with gr.Row():
|
@@ -134,6 +135,6 @@ with gr.Blocks() as demo:
|
|
134 |
pred = gr.Image(label="Predicted Heatmap", visible=True)
|
135 |
|
136 |
check_button.click(text_fn, inputs=[inp, out], outputs=[pred])
|
137 |
-
slider.change(thresh_fn, slider, pred)
|
138 |
|
139 |
demo.launch()
|
|
|
111 |
|
112 |
rgba_img = cmap(preds)
|
113 |
rgb_img = np.delete(rgba_img, 3, 2)
|
114 |
+
return rgb_img, "Confidence Threshold: " + str(val)
|
115 |
|
116 |
with gr.Blocks() as demo:
|
117 |
gr.Markdown(
|
|
|
122 |
with gr.Row():
|
123 |
inp = gr.Dropdown(label="Taxonomic Hierarchy", choices=["Class", "Order", "Family", "Genus", "Species"])
|
124 |
out = gr.Dropdown(label="Name", interactive=True)
|
125 |
+
text = gr.Textbox(label="Natural Language Description")
|
126 |
inp.change(update_fn, inp, out)
|
127 |
|
128 |
with gr.Row():
|
|
|
135 |
pred = gr.Image(label="Predicted Heatmap", visible=True)
|
136 |
|
137 |
check_button.click(text_fn, inputs=[inp, out], outputs=[pred])
|
138 |
+
slider.change(thresh_fn, slider, outputs=[pred,text])
|
139 |
|
140 |
demo.launch()
|