Spaces:
Sleeping
Sleeping
Tirath5504
commited on
Commit
•
be8f613
1
Parent(s):
f260cda
Update app.py
Browse files
app.py
CHANGED
@@ -21,9 +21,9 @@ def predict(image):
|
|
21 |
# return predicted_class
|
22 |
|
23 |
probabilities = F.softmax(outputs, dim=1)
|
24 |
-
confidence_score = probabilities[0][predicted_class_idx].item()
|
25 |
predicted_class_idx = probabilities.argmax(-1).item()
|
26 |
predicted_class = class_names[predicted_class_idx]
|
|
|
27 |
|
28 |
return predicted_class, confidence_score
|
29 |
|
|
|
21 |
# return predicted_class
|
22 |
|
23 |
probabilities = F.softmax(outputs, dim=1)
|
|
|
24 |
predicted_class_idx = probabilities.argmax(-1).item()
|
25 |
predicted_class = class_names[predicted_class_idx]
|
26 |
+
confidence_score = probabilities[0][predicted_class_idx].item()
|
27 |
|
28 |
return predicted_class, confidence_score
|
29 |
|