Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -47,7 +47,7 @@ def predict_and_explain(img):
|
|
| 47 |
pred_name = class_names[pred_idx]
|
| 48 |
|
| 49 |
targets = [ClassifierOutputTarget(pred_idx)]
|
| 50 |
-
cam = GradCAMPlusPlus(model=model, target_layers=[model.blocks[-1][-1]]
|
| 51 |
grayscale_cam = cam(input_tensor=input_tensor, targets=targets)[0]
|
| 52 |
|
| 53 |
image_np = np.array(image_pil).astype(np.float32) / 255.0
|
|
|
|
| 47 |
pred_name = class_names[pred_idx]
|
| 48 |
|
| 49 |
targets = [ClassifierOutputTarget(pred_idx)]
|
| 50 |
+
cam = GradCAMPlusPlus(model=model, target_layers=[model.blocks[-1][-1]])
|
| 51 |
grayscale_cam = cam(input_tensor=input_tensor, targets=targets)[0]
|
| 52 |
|
| 53 |
image_np = np.array(image_pil).astype(np.float32) / 255.0
|