Update gradcam.py
Browse files- gradcam.py +1 -1
gradcam.py
CHANGED
@@ -77,7 +77,7 @@ class GradCam():
|
|
77 |
topIdx = logits.cpu()[0, :].detach().numpy().argsort()[-1]
|
78 |
topClass = model.config.id2label[topIdx]
|
79 |
topScore = probabilities[0][topIdx].item()
|
80 |
-
return {"label": topClass, "score": topScore}
|
81 |
|
82 |
def reshape_transform_vit_huggingface(self, x):
|
83 |
activations = x[:, 1:, :]
|
|
|
77 |
topIdx = logits.cpu()[0, :].detach().numpy().argsort()[-1]
|
78 |
topClass = model.config.id2label[topIdx]
|
79 |
topScore = probabilities[0][topIdx].item()
|
80 |
+
return [{"label": topClass, "score": topScore}]
|
81 |
|
82 |
def reshape_transform_vit_huggingface(self, x):
|
83 |
activations = x[:, 1:, :]
|