dhhd255 commited on
Commit
0a3512b
·
1 Parent(s): da8e58b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -74,10 +74,12 @@ if uploaded_file is not None:
74
 
75
  logits = feature_reducer(logits)
76
  predicted_class = torch.argmax(logits, dim=1).item()
 
77
  if(predicted_class == 0):
78
  col2.markdown('<span class="result parkinsons">Predicted class: Parkinson\'s</span>', unsafe_allow_html=True)
 
79
  else:
80
  col2.markdown('<span class="result healthy">Predicted class: Healthy</span>', unsafe_allow_html=True)
81
-
82
  # Add the footer
83
  st.markdown('<div class="footer">Hello</div>', unsafe_allow_html=True)
 
74
 
75
  logits = feature_reducer(logits)
76
  predicted_class = torch.argmax(logits, dim=1).item()
77
+ confidence = torch.softmax(logits, dim=1)[0][predicted_class].item()
78
  if(predicted_class == 0):
79
  col2.markdown('<span class="result parkinsons">Predicted class: Parkinson\'s</span>', unsafe_allow_html=True)
80
+ st.caption(f'{confidence*100:.0f}% sure')
81
  else:
82
  col2.markdown('<span class="result healthy">Predicted class: Healthy</span>', unsafe_allow_html=True)
83
+ st.caption(f'{confidence*100:.0f}% sure')
84
  # Add the footer
85
  st.markdown('<div class="footer">Hello</div>', unsafe_allow_html=True)