Update app.py
Browse files
app.py
CHANGED
|
@@ -30,8 +30,8 @@ def predict(image):
|
|
| 30 |
|
| 31 |
# Perform post-processing if needed (e.g., softmax for probabilities)
|
| 32 |
# Replace this with your actual post-processing logic
|
| 33 |
-
|
| 34 |
-
|
| 35 |
|
| 36 |
# Map the class indices to class labels
|
| 37 |
class_labels = ["Class1", "Class2", "Class3", "Class4"]
|
|
|
|
| 30 |
|
| 31 |
# Perform post-processing if needed (e.g., softmax for probabilities)
|
| 32 |
# Replace this with your actual post-processing logic
|
| 33 |
+
probabilities = torch.softmax(output.logits, dim=1).squeeze().tolist()
|
| 34 |
+
|
| 35 |
|
| 36 |
# Map the class indices to class labels
|
| 37 |
class_labels = ["Class1", "Class2", "Class3", "Class4"]
|