nusaibah0110 commited on
Commit
a453100
·
1 Parent(s): 9e1ba1f
frontend/src/components/ResultsPanel.tsx CHANGED
@@ -104,9 +104,10 @@ export function ResultsPanel({ uploadedImage, result, loading }: ResultsPanelPro
104
  return "";
105
  }
106
  };
107
- const predictedClass = (summary && (summary.prediction || summary.result))
108
- ? String(summary.prediction || summary.result)
109
- : predictedClassFromConfidence(confidence || {});
 
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