Spaces:
Build error
Build error
final fix
Browse files
app.py
CHANGED
|
@@ -77,12 +77,8 @@ def predict(img) -> Tuple[Dict, float]:
|
|
| 77 |
pred_probs = torch.sigmoid(effnetb2(img)).squeeze()
|
| 78 |
|
| 79 |
# Create a prediction label and prediction probability dictionary for each prediction class (this is the required format for Gradio's output parameter)
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
'Normal': 1-pred_probs.item(), 'Pneumonia': pred_probs.item()}
|
| 83 |
-
else:
|
| 84 |
-
pred_labels_and_probs = {
|
| 85 |
-
'Normal': pred_probs.item(), 'Pneumonia': 1-pred_probs.item()}
|
| 86 |
|
| 87 |
# Calculate the prediction time
|
| 88 |
pred_time = round(timer() - start_time, 5)
|
|
|
|
| 77 |
pred_probs = torch.sigmoid(effnetb2(img)).squeeze()
|
| 78 |
|
| 79 |
# Create a prediction label and prediction probability dictionary for each prediction class (this is the required format for Gradio's output parameter)
|
| 80 |
+
pred_labels_and_probs = {
|
| 81 |
+
'Normal': 1-pred_probs.item(), 'Pneumonia': pred_probs.item()}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 82 |
|
| 83 |
# Calculate the prediction time
|
| 84 |
pred_time = round(timer() - start_time, 5)
|