Giftmutie commited on
Commit
e8b6507
·
verified ·
1 Parent(s): 5c1433b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -189,9 +189,9 @@ async def predict(file: UploadFile = File(...)):
189
  # 2. Low confidence AND the top predictions are bunched together
190
  # (model is guessing randomly across classes)
191
  is_invalid = (
192
- top1_confidence < 0.55 # extremely low confidence
193
- or (top1_confidence < 0.60 and top1_top2_gap < 0.30) # low + no clear winner
194
- or (top1_confidence < 0.60 and top3_spread < 0.35) # low + very spread out
195
  )
196
 
197
  if is_invalid:
 
189
  # 2. Low confidence AND the top predictions are bunched together
190
  # (model is guessing randomly across classes)
191
  is_invalid = (
192
+ top1_confidence < 0.30 # extremely low confidence
193
+ or (top1_confidence < 0.35 and top1_top2_gap < 0.20) # low + no clear winner
194
+ or (top1_confidence < 0.35 and top3_spread < 0.25) # low + very spread out
195
  )
196
 
197
  if is_invalid: