whdii / TMM

8 stars 2 forks source link

where is "self.getGradCam" #3

Open Zhou-AY opened 2 months ago

Zhou-AY commented 2 months ago

In line 82 of file multimodalAttack.py, where is "self.getGradCam" defined? Could you please improve the code?Thank you.

chilljudaoren commented 1 month ago
def getGradCam(self, gradcam, shape):
    # 示例方法,假设对 gradcam 进行插值以匹配给定的形状
    gradcam = torch.nn.functional.interpolate(gradcam.unsqueeze(0), size=shape, mode='bilinear', align_corners=False)
    return gradcam.squeeze(0)
chilljudaoren commented 3 weeks ago

请问您解决了嘛?