Spaces:
Sleeping
Sleeping
Show predicted vs actual only (drop confidence/probs)
Browse files
app.py
CHANGED
|
@@ -61,23 +61,21 @@ def _valid_indices():
|
|
| 61 |
|
| 62 |
|
| 63 |
def _clip_view(i: int):
|
| 64 |
-
"""Return (image_path, result_markdown) for gallery item i."""
|
| 65 |
g = GALLERY[i]
|
| 66 |
img = str(ASSETS / "gallery" / g.get("raw_gif", g.get("gif", "")))
|
| 67 |
-
|
| 68 |
-
probs = g.get("probs", [])
|
| 69 |
-
bar = " Β· ".join(f"{LABELS3[k]} {probs[k]:.2f}" for k in range(len(probs))) if probs else ""
|
| 70 |
note = ""
|
| 71 |
if not g.get("correct"):
|
| 72 |
if g["true"] == "pre-mitosis" and g["pred"] == "interphase":
|
| 73 |
-
note = "\n\n*
|
| 74 |
elif g["true"] == "mitosis":
|
| 75 |
-
note = "\n\n*A missed division β the rare, high-value event
|
| 76 |
elif g["pred"] == "pre-mitosis":
|
| 77 |
note = "\n\n*Over-called: interphase nucleus flagged as entering division.*"
|
| 78 |
-
md = (f"###
|
| 79 |
-
f"{
|
| 80 |
-
f"
|
| 81 |
return img, md
|
| 82 |
|
| 83 |
|
|
|
|
| 61 |
|
| 62 |
|
| 63 |
def _clip_view(i: int):
|
| 64 |
+
"""Return (image_path, result_markdown) for gallery item i β predicted vs actual only."""
|
| 65 |
g = GALLERY[i]
|
| 66 |
img = str(ASSETS / "gallery" / g.get("raw_gif", g.get("gif", "")))
|
| 67 |
+
icon = "β
" if g.get("correct") else "β"
|
|
|
|
|
|
|
| 68 |
note = ""
|
| 69 |
if not g.get("correct"):
|
| 70 |
if g["true"] == "pre-mitosis" and g["pred"] == "interphase":
|
| 71 |
+
note = "\n\n*'Pre-mitosis' is a soft, lineage-defined window β this nucleus looks identical to interphase (not yet rounded/condensed).*"
|
| 72 |
elif g["true"] == "mitosis":
|
| 73 |
+
note = "\n\n*A missed division β the rare, high-value event.*"
|
| 74 |
elif g["pred"] == "pre-mitosis":
|
| 75 |
note = "\n\n*Over-called: interphase nucleus flagged as entering division.*"
|
| 76 |
+
md = (f"### Predicted: **{g['pred']}**\n\n"
|
| 77 |
+
f"### Actual: **{g['true']}**\n\n"
|
| 78 |
+
f"{icon} {'correct' if g.get('correct') else 'incorrect'}{note}")
|
| 79 |
return img, md
|
| 80 |
|
| 81 |
|