Spaces:
Sleeping
Sleeping
Commit
•
6ff0ed5
1
Parent(s):
eb1bcd9
Updated "non-understood" threshold.
Browse files
app.py
CHANGED
@@ -21,7 +21,7 @@ def predict(img) -> Tuple[Dict, float]:
|
|
21 |
y_logits = MODEL(X)
|
22 |
y_prob = torch.softmax(y_logits, dim=1)
|
23 |
# Prediction threshold for non understood images.
|
24 |
-
if y_prob.max() < .
|
25 |
raise gr.Error("This image might not be of food.")
|
26 |
# Float casting due to Gradio's assumption that numpy objects
|
27 |
# should be iterated. Running `tolist()` prior to this
|
|
|
21 |
y_logits = MODEL(X)
|
22 |
y_prob = torch.softmax(y_logits, dim=1)
|
23 |
# Prediction threshold for non understood images.
|
24 |
+
if y_prob.max() < .15:
|
25 |
raise gr.Error("This image might not be of food.")
|
26 |
# Float casting due to Gradio's assumption that numpy objects
|
27 |
# should be iterated. Running `tolist()` prior to this
|