Synopsis / amalgam

Extensions for the `fastai2` library in the form of data augmentations and inference utilities. Specific to computer vision models. Inference utilities are built with a focus on single-label (softmax) classifiers.
https://synopsis.video/fastai2_extensions//
Apache License 2.0
48 stars 5 forks source link

Add full_size parameter again #1

Closed lluissalord closed 3 years ago

lluissalord commented 3 years ago

First, thank you for this cool library of extensions, by now I have only used GradCAM, but for sure I am going to use other extensions which seems also to be useful.

Here I suggest you a minor parameter to add again (seems that it was being used before but for some reason it has been removed). This parameters allows to correctly plot GradCAM when there are some Resize/Crop transformations on the DataLoader, because it is better (at least from my point of view) to use directly the x value output of the test_dl as then you can make sure that it is using the same image as the one used by the model. Hence, for me make sense to have this setup as default, otherwise can happen to plot inconsistent heatmaps.

lluissalord commented 3 years ago

On the last commit I have added a cmap parameter and gcam_cmap which allows you to choose the colormaps for the image itself and for the heatmap separately.

This has been useful for me because I am working with medical imaging and I prefer cmap with plt.cm.bone which gives better visualization for radiographies.

lluissalord commented 3 years ago

I see that the checks are failing, seems like I should run some codes, could you please help me with this?

rsomani95 commented 3 years ago

Hi @lluissalord, thank you for your PR! I'm glad you find this repo useful.

You caught me at an awkward time as I'm in the process of doing some major changes in the codebase. Most of the code-logic changes have been done, but I haven't put in place the infra to facilitate smooth PRs, update documentation, write tests, etc. Don't worry about the tests failing, that's got to do with my previous commits -- something I need to fix.

That being said, the changes you've proposed here make sense to me. Give me a day or two to go through it and I'll merge it.

rsomani95 commented 3 years ago

Thanks @lluissalord!

I may change the default heatmap later after I try a few; but this is looking great :)