Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -77,13 +77,13 @@ def predict(image: Image.Image):
|
|
| 77 |
sp_conf = float(prob_sp[sp_id].item())
|
| 78 |
st_conf = float(prob_st[st_id].item())
|
| 79 |
|
| 80 |
-
sp_text = f"{SPECIES[sp_id]} (id={sp_id},
|
| 81 |
-
st_text = f"{STATE[st_id]} (id={st_id},
|
| 82 |
|
| 83 |
return sp_text, st_text
|
| 84 |
|
| 85 |
EXAMPLE_TEXT = """
|
| 86 |
-
12
|
| 87 |
Heriades, Hylaeus, Megachile, Osmia bicornis, Osmia cornuta, Passaloecus, Psenulus, Trypoxylon
|
| 88 |
|
| 89 |
4 states: DauLv, DeadLv, Lv, OldFood
|
|
@@ -93,7 +93,7 @@ demo = gr.Interface(
|
|
| 93 |
fn=predict,
|
| 94 |
inputs=gr.Image(type="pil"),
|
| 95 |
outputs=[
|
| 96 |
-
gr.Textbox(label="Predicted
|
| 97 |
gr.Textbox(label="Predicted state"),
|
| 98 |
],
|
| 99 |
title="EfficientNet Two-Head Layer Trap Nest (LTN) Classifier",
|
|
|
|
| 77 |
sp_conf = float(prob_sp[sp_id].item())
|
| 78 |
st_conf = float(prob_st[st_id].item())
|
| 79 |
|
| 80 |
+
sp_text = f"{SPECIES[sp_id]} (id={sp_id}, score={sp_conf:.3f})"
|
| 81 |
+
st_text = f"{STATE[st_id]} (id={st_id}, score={st_conf:.3f})"
|
| 82 |
|
| 83 |
return sp_text, st_text
|
| 84 |
|
| 85 |
EXAMPLE_TEXT = """
|
| 86 |
+
12 taxa: Cacoxnus indagator, Chelostoma florisomne, Coeliopencyrtus, Eumenidae,
|
| 87 |
Heriades, Hylaeus, Megachile, Osmia bicornis, Osmia cornuta, Passaloecus, Psenulus, Trypoxylon
|
| 88 |
|
| 89 |
4 states: DauLv, DeadLv, Lv, OldFood
|
|
|
|
| 93 |
fn=predict,
|
| 94 |
inputs=gr.Image(type="pil"),
|
| 95 |
outputs=[
|
| 96 |
+
gr.Textbox(label="Predicted taxon"),
|
| 97 |
gr.Textbox(label="Predicted state"),
|
| 98 |
],
|
| 99 |
title="EfficientNet Two-Head Layer Trap Nest (LTN) Classifier",
|