pytorch-grad-cam icon indicating copy to clipboard operation
pytorch-grad-cam copied to clipboard

Use custom test-time augmentations

Open Kaushalya opened this issue 3 years ago • 2 comments

Thank you for creating this library. I slightly modified BaseCAM to pass a ttach.Compose object so we can use a custom set of test-time augmentations in forward_augmentation_smoothing().

Kaushalya avatar Jan 31 '22 11:01 Kaushalya

Hi, Sorry for the very late reply. And thanks for this PR! going to merge this !

Was curious if you have examples of test time augmentations that worked in your case? Did they work better than the default ones? I'm wondering if this is something worth adding to the Readme.

jacobgil avatar Mar 12 '22 14:03 jacobgil

Hi, Thanks for checking the PR. Vertical flipping helped in my case where I was training a classifier on a private medical imaging dataset. Vertical flip and minor rotations improve the prediction performance in medical imaging applications. Additionally, I wanted to have the same custom set of augmentations during inference and visualization of CAM images.

Kaushalya avatar Mar 21 '22 02:03 Kaushalya

Better later than never, this was merged, thank you for the contribution!

jacobgil avatar Dec 09 '23 12:12 jacobgil