data
Browse files
app.py
CHANGED
@@ -58,7 +58,7 @@ species = np.load("data/species_70b.npy", allow_pickle=True)
|
|
58 |
clas = np.load("data/class_70b.npy", allow_pickle=True)
|
59 |
order = np.load("data/order_70b.npy", allow_pickle=True)
|
60 |
#genus = np.load("genus_70b.npy")
|
61 |
-
family = np.load("family_70b.npy")
|
62 |
|
63 |
species_list = list(species[()].keys())
|
64 |
class_list = list(clas[()].keys())
|
@@ -97,7 +97,7 @@ def text_fn(taxon, name):
|
|
97 |
rgba_img = cmap(preds)
|
98 |
rgb_img = np.delete(rgba_img, 3, 2)
|
99 |
#return gr.Image(preds, label="Predicted Heatmap", visible=True)
|
100 |
-
return
|
101 |
|
102 |
def pred_fn(taxon, name):
|
103 |
if taxon=="Class":
|
@@ -125,17 +125,17 @@ with gr.Blocks() as demo:
|
|
125 |
with gr.Row():
|
126 |
inp = gr.Dropdown(label="Taxonomic Hierarchy", choices=["Class", "Order", "Family", "Genus", "Species"])
|
127 |
out = gr.Dropdown(label="Name", interactive=True)
|
128 |
-
text = gr.Textbox(label="Text", visible=True, interactive=True)
|
129 |
inp.change(update_fn, inp, out)
|
130 |
|
131 |
with gr.Row():
|
132 |
-
check_button = gr.Button("
|
133 |
-
|
|
|
|
|
134 |
|
135 |
with gr.Row():
|
136 |
pred = gr.Image(label="Predicted Heatmap", visible=True)
|
137 |
|
138 |
-
check_button.click(text_fn, inputs=[inp, out], outputs=[
|
139 |
-
#submit_button.click(pred_fn, inputs=[inp, out], outputs=[pred])
|
140 |
|
141 |
demo.launch()
|
|
|
58 |
clas = np.load("data/class_70b.npy", allow_pickle=True)
|
59 |
order = np.load("data/order_70b.npy", allow_pickle=True)
|
60 |
#genus = np.load("genus_70b.npy")
|
61 |
+
family = np.load("data/family_70b.npy")
|
62 |
|
63 |
species_list = list(species[()].keys())
|
64 |
class_list = list(clas[()].keys())
|
|
|
97 |
rgba_img = cmap(preds)
|
98 |
rgb_img = np.delete(rgba_img, 3, 2)
|
99 |
#return gr.Image(preds, label="Predicted Heatmap", visible=True)
|
100 |
+
return rgb_img
|
101 |
|
102 |
def pred_fn(taxon, name):
|
103 |
if taxon=="Class":
|
|
|
125 |
with gr.Row():
|
126 |
inp = gr.Dropdown(label="Taxonomic Hierarchy", choices=["Class", "Order", "Family", "Genus", "Species"])
|
127 |
out = gr.Dropdown(label="Name", interactive=True)
|
|
|
128 |
inp.change(update_fn, inp, out)
|
129 |
|
130 |
with gr.Row():
|
131 |
+
check_button = gr.Button("Run Model")
|
132 |
+
|
133 |
+
with gr.Row():
|
134 |
+
slider = gr.Slider(minimum=0, maximum=1, step=0.01, default=0.5, label="Confidence Threshold")
|
135 |
|
136 |
with gr.Row():
|
137 |
pred = gr.Image(label="Predicted Heatmap", visible=True)
|
138 |
|
139 |
+
check_button.click(text_fn, inputs=[inp, out], outputs=[pred])
|
|
|
140 |
|
141 |
demo.launch()
|