VaneshDev commited on
Commit
12b942f
·
verified ·
1 Parent(s): 99e561f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -64,8 +64,9 @@ def predict_xray(image):
64
  # Handle case where predicted class might not be in our list of conditions
65
  most_likely_condition = max(results, key=results.get)
66
 
67
- # Ensure the predicted condition is in the valid conditions list
68
  if most_likely_condition not in conditions:
 
69
  most_likely_condition = "Other"
70
  confidence = 0.0
71
  else:
 
64
  # Handle case where predicted class might not be in our list of conditions
65
  most_likely_condition = max(results, key=results.get)
66
 
67
+ # Check if the predicted class is in the list of valid conditions
68
  if most_likely_condition not in conditions:
69
+ logger.warning(f"Unexpected condition predicted: {most_likely_condition}. Defaulting to 'Other'.")
70
  most_likely_condition = "Other"
71
  confidence = 0.0
72
  else: