Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -40,7 +40,7 @@ def predict(img) -> Tuple[Dict, float]:
|
|
40 |
effnet_b1.eval()
|
41 |
with torch.inference_mode():
|
42 |
# Pass the transformed image through the model and turn the prediction logits into prediction probabilities
|
43 |
-
pred_probs = torch.softmax(
|
44 |
|
45 |
# Create a prediction label and prediction probability dictionary for each prediction class (this is the required format for Gradio's output parameter)
|
46 |
pred_labels_and_probs = {class_names[i]: float(pred_probs[0][i]) for i in range(len(class_names))}
|
|
|
40 |
effnet_b1.eval()
|
41 |
with torch.inference_mode():
|
42 |
# Pass the transformed image through the model and turn the prediction logits into prediction probabilities
|
43 |
+
pred_probs = torch.softmax(effnet_b1(img), dim=1)
|
44 |
|
45 |
# Create a prediction label and prediction probability dictionary for each prediction class (this is the required format for Gradio's output parameter)
|
46 |
pred_labels_and_probs = {class_names[i]: float(pred_probs[0][i]) for i in range(len(class_names))}
|