Minbz commited on
Commit
f09afe9
·
verified ·
1 Parent(s): 4dc6eec

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -33,11 +33,14 @@ def predict(image):
33
 
34
  # Perform inference
35
  predictions = model.predict(input_tensor)
 
 
 
36
 
37
  # Extract the predicted class label with the highest probability
38
- prediction = np.argmax(predictions[0])
39
 
40
- if(prediction > 0.5):
41
  return "Pneumonia"
42
  else:
43
  return "Normal"
 
33
 
34
  # Perform inference
35
  predictions = model.predict(input_tensor)
36
+
37
+ predicted_probabilities = np.squeeze(predictions)
38
+ predicted_class = np.argmax(predicted_probabilities)
39
 
40
  # Extract the predicted class label with the highest probability
41
+ # prediction = np.argmax(predictions[0])
42
 
43
+ if(predicted_class > 0.5):
44
  return "Pneumonia"
45
  else:
46
  return "Normal"