Spaces:
Sleeping
Sleeping
Commit
·
a453100
1
Parent(s):
9e1ba1f
Updates
Browse files
frontend/src/components/ResultsPanel.tsx
CHANGED
|
@@ -104,9 +104,10 @@ export function ResultsPanel({ uploadedImage, result, loading }: ResultsPanelPro
|
|
| 104 |
return "";
|
| 105 |
}
|
| 106 |
};
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
|
|
|
| 110 |
|
| 111 |
|
| 112 |
|
|
|
|
| 104 |
return "";
|
| 105 |
}
|
| 106 |
};
|
| 107 |
+
// Prefer the class key present in the `confidence` object to ensure we use the exact key/casing
|
| 108 |
+
// (this avoids showing all bars when `summary.prediction` has different casing/format).
|
| 109 |
+
const predictedClass = predictedClassFromConfidence(confidence || {}) ||
|
| 110 |
+
((summary && (summary.prediction || summary.result)) ? String(summary.prediction || summary.result) : "");
|
| 111 |
|
| 112 |
|
| 113 |
|