Aziizzz commited on
Commit
5fc00a2
·
1 Parent(s): f7021e5
Files changed (1) hide show
  1. app.py +2 -6
app.py CHANGED
@@ -77,12 +77,8 @@ def predict(img) -> Tuple[Dict, float]:
77
  pred_probs = torch.sigmoid(effnetb2(img)).squeeze()
78
 
79
  # Create a prediction label and prediction probability dictionary for each prediction class (this is the required format for Gradio's output parameter)
80
- if (torch.round(pred_probs) == 1):
81
- pred_labels_and_probs = {
82
- 'Normal': 1-pred_probs.item(), 'Pneumonia': pred_probs.item()}
83
- else:
84
- pred_labels_and_probs = {
85
- 'Normal': pred_probs.item(), 'Pneumonia': 1-pred_probs.item()}
86
 
87
  # Calculate the prediction time
88
  pred_time = round(timer() - start_time, 5)
 
77
  pred_probs = torch.sigmoid(effnetb2(img)).squeeze()
78
 
79
  # Create a prediction label and prediction probability dictionary for each prediction class (this is the required format for Gradio's output parameter)
80
+ pred_labels_and_probs = {
81
+ 'Normal': 1-pred_probs.item(), 'Pneumonia': pred_probs.item()}
 
 
 
 
82
 
83
  # Calculate the prediction time
84
  pred_time = round(timer() - start_time, 5)