xujinheng666 commited on
Commit
3d20cd6
·
verified ·
1 Parent(s): 0af6942

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -25,7 +25,8 @@ if uploaded_file is not None:
25
  st.write("Classifying...")
26
  results = classifier(image)
27
 
28
- # Display results
29
- st.subheader("Results:")
30
- for result in results:
31
- st.write(f"**{result['label']}** - Score: {result['score']:.4f}")
 
 
25
  st.write("Classifying...")
26
  results = classifier(image)
27
 
28
+ # Get the label with the highest score
29
+ if results:
30
+ best_result = max(results, key=lambda x: x["score"])
31
+ st.subheader("Predicted Age Category:")
32
+ st.write(f"🟢 **{best_result['label']}** (Confidence: {best_result['score']:.4f})")