ongkn commited on
Commit
76b7891
1 Parent(s): 1cd7494

Update gradcam.py

Browse files
Files changed (1) hide show
  1. 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:, :]