rishabh5752 commited on
Commit
d869637
·
1 Parent(s): 3ef24f4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -17,13 +17,12 @@ def predict(image):
17
  # Get the predicted class label
18
  if prediction[0][0] < 0.5:
19
  label = 'Benign'
 
20
  else:
21
  label = 'Malignant'
 
22
 
23
- # Get the sigmoid percentage
24
- sigmoid_percentage = f"{prediction[0][0] * 100:.2f}%"
25
-
26
- return f"{label} ({sigmoid_percentage})", sigmoid_percentage
27
 
28
  examples = [["benign.jpg"], ["malignant.jpg"]]
29
 
 
17
  # Get the predicted class label
18
  if prediction[0][0] < 0.5:
19
  label = 'Benign'
20
+ confidence = 1 - prediction[0][0] # Confidence for benign
21
  else:
22
  label = 'Malignant'
23
+ confidence = prediction[0][0] # Confidence for malignant
24
 
25
+ return {'label': label, 'confidence': confidence}
 
 
 
26
 
27
  examples = [["benign.jpg"], ["malignant.jpg"]]
28