Jfink09 commited on
Commit
168004e
·
verified ·
1 Parent(s): ea54c11

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -85,7 +85,7 @@ def predict(img):
85
  pred_labels_and_probs = {class_names[i]: float(pred_probs[0][i]) for i in range(len(class_names))}
86
 
87
  # OOD Detection - modify existing probabilities instead of adding new keys
88
- if (max_prob > 0.95 and entropy < 0.2) or entropy > 2.0:
89
  # Boost the probability of the first class and add a marker
90
  pred_labels_and_probs[class_names[0]] = 0.99 # Use existing class
91
  # You could also just print a warning or log it
 
85
  pred_labels_and_probs = {class_names[i]: float(pred_probs[0][i]) for i in range(len(class_names))}
86
 
87
  # OOD Detection - modify existing probabilities instead of adding new keys
88
+ if (max_prob > 0.95 and entropy < 0.05) or entropy > 0.1:
89
  # Boost the probability of the first class and add a marker
90
  pred_labels_and_probs[class_names[0]] = 0.99 # Use existing class
91
  # You could also just print a warning or log it