Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
#
|
| 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:
|