Spaces:
Sleeping
Sleeping
Yahia battach
commited on
Commit
•
4e412dc
1
Parent(s):
29309b0
edit app.py
Browse files- .gitignore +2 -0
- app.py +34 -38
.gitignore
CHANGED
@@ -1,2 +1,4 @@
|
|
1 |
.venv/
|
2 |
__pycache__/
|
|
|
|
|
|
1 |
.venv/
|
2 |
__pycache__/
|
3 |
+
|
4 |
+
.DS_Store
|
app.py
CHANGED
@@ -62,34 +62,30 @@ open_domain_examples = [
|
|
62 |
|
63 |
zero_shot_examples = [
|
64 |
[
|
65 |
-
"examples/
|
66 |
-
"
|
67 |
],
|
68 |
-
["examples/
|
69 |
-
["examples/
|
70 |
[
|
71 |
-
"examples/
|
72 |
-
"
|
73 |
],
|
74 |
[
|
75 |
-
"examples/
|
76 |
-
"
|
77 |
],
|
78 |
[
|
79 |
-
"examples/
|
80 |
-
"
|
81 |
],
|
82 |
[
|
83 |
-
"examples/
|
84 |
-
"
|
85 |
],
|
86 |
[
|
87 |
-
"examples/
|
88 |
-
"
|
89 |
-
],
|
90 |
-
[
|
91 |
-
"examples/Onoclea-sensibilis.jpg",
|
92 |
-
"Onoclea attenuata\nOnoclea boryana\nOnoclea hintonii\nOnoclea intermedia\nOnoclea sensibilis",
|
93 |
],
|
94 |
]
|
95 |
|
@@ -215,31 +211,31 @@ if __name__ == "__main__":
|
|
215 |
|
216 |
with gr.Column():
|
217 |
# display sample image of top predicted taxon
|
218 |
-
sample_img = gr.Image(label = "Sample Image of Predicted Taxon",
|
219 |
-
|
220 |
-
|
221 |
|
222 |
-
taxon_url = gr.HTML(label = "More Information",
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
with gr.Row():
|
227 |
-
with gr.Column():
|
228 |
-
rank_dropdown = gr.Dropdown(
|
229 |
-
label="Taxonomic Rank",
|
230 |
-
info="Which taxonomic rank to predict. Fine-grained ranks (genus, species) are more challenging.",
|
231 |
-
choices=ranks,
|
232 |
-
value="Species",
|
233 |
-
type="index",
|
234 |
-
)
|
235 |
-
open_domain_btn = gr.Button("Submit", variant="primary")
|
236 |
-
with gr.Column():
|
237 |
open_domain_output = gr.Label(
|
238 |
num_top_classes=k,
|
239 |
label="Prediction",
|
240 |
show_label=True,
|
241 |
value=None,
|
242 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
243 |
# open_domain_flag_btn = gr.Button("Flag Mistake", variant="primary")
|
244 |
|
245 |
with gr.Row():
|
@@ -273,11 +269,11 @@ if __name__ == "__main__":
|
|
273 |
with gr.Row():
|
274 |
with gr.Column():
|
275 |
classes_txt = gr.Textbox(
|
276 |
-
placeholder="
|
277 |
lines=3,
|
278 |
label="Classes",
|
279 |
show_label=True,
|
280 |
-
info="Use taxonomic names
|
281 |
)
|
282 |
zero_shot_btn = gr.Button("Submit", variant="primary")
|
283 |
|
|
|
62 |
|
63 |
zero_shot_examples = [
|
64 |
[
|
65 |
+
"examples/Acropora-gemmifera.jpg",
|
66 |
+
"Acropora aculeus\nAcropora acuminata\nAcropora anthocercis\nAcropora appressa\nAcropora arabensis"
|
67 |
],
|
68 |
+
["examples/porities_lobata.jpg", "Porities lobata\nPorites astreoides"],
|
69 |
+
["examples/Euphyllia_paraancora.jpg", "Euphyllia paraancora\nEuphyllia paradivisa"],
|
70 |
[
|
71 |
+
"examples/Montipora_patula.jpg",
|
72 |
+
"Montipora patula\nMontipora peltiformis \nMontipora saudii\nMontipora caliculata\nMontipora capitata\nMontipora cebuensis\nMontipora carinata",
|
73 |
],
|
74 |
[
|
75 |
+
"examples/Astreopora_listeri.jpg",
|
76 |
+
"Animalia Cnidaria Anthozoa Scleractinia Acroporidae Acropora hyacinthus\nAnimalia Cnidaria Anthozoa Scleractinia Acroporidae Acropora aculeus\nAnimalia Cnidaria Anthozoa Scleractinia Acroporidae Acropora anthocercis\nAnimalia Cnidaria Anthozoa Scleractinia Acroporidae Acropora millepora\nAnimalia Cnidaria Anthozoa Scleractinia Acroporidae Acropora gemmifera",
|
77 |
],
|
78 |
[
|
79 |
+
"examples/Turbinaria_heronensis.jpg",
|
80 |
+
"Turbinaria heronensis\nTurbinaria mesenterina\nTurbinaria patula\nTurbinaria peltata",
|
81 |
],
|
82 |
[
|
83 |
+
"examples/Montipora_peltiformis.jpg",
|
84 |
+
"Montipora peltiformis\nMontipora capricornis\nMontipora carinata\nMontipora cebuensis\nMontipora circumvallata",
|
85 |
],
|
86 |
[
|
87 |
+
"examples/Agaricia_agaricites.jpg",
|
88 |
+
"Agaricia agaricites\nAgaricia fragilis\nAgaricia grahamae\nAgaricia humilis\nAgaricia lamarcki",
|
|
|
|
|
|
|
|
|
89 |
],
|
90 |
]
|
91 |
|
|
|
211 |
|
212 |
with gr.Column():
|
213 |
# display sample image of top predicted taxon
|
214 |
+
# sample_img = gr.Image(label = "Sample Image of Predicted Taxon",
|
215 |
+
# height = 400,
|
216 |
+
# show_download_button = False)
|
217 |
|
218 |
+
# taxon_url = gr.HTML(label = "More Information",
|
219 |
+
# elem_id = "url"
|
220 |
+
# )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
221 |
open_domain_output = gr.Label(
|
222 |
num_top_classes=k,
|
223 |
label="Prediction",
|
224 |
show_label=True,
|
225 |
value=None,
|
226 |
)
|
227 |
+
|
228 |
+
|
229 |
+
with gr.Row():
|
230 |
+
rank_dropdown = gr.Dropdown(
|
231 |
+
label="Taxonomic Rank",
|
232 |
+
info="Which taxonomic rank to predict. Fine-grained ranks (genus, species) are more challenging.",
|
233 |
+
choices=ranks,
|
234 |
+
value="Species",
|
235 |
+
type="index",
|
236 |
+
)
|
237 |
+
open_domain_btn = gr.Button("Submit", variant="primary")
|
238 |
+
|
239 |
# open_domain_flag_btn = gr.Button("Flag Mistake", variant="primary")
|
240 |
|
241 |
with gr.Row():
|
|
|
269 |
with gr.Row():
|
270 |
with gr.Column():
|
271 |
classes_txt = gr.Textbox(
|
272 |
+
placeholder="Montipora peltiformis \nMontipora saudii...",
|
273 |
lines=3,
|
274 |
label="Classes",
|
275 |
show_label=True,
|
276 |
+
info="Use taxonomic names",
|
277 |
)
|
278 |
zero_shot_btn = gr.Button("Submit", variant="primary")
|
279 |
|