Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add changes to work better with pytorch-grad-cam #64

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

johnbradley
Copy link
Collaborator

Changes classifier base class to extend nn.Module and implements the forward() method so the classifiers can be used with pytorch-grad-cam. torch.no_grad was removed from create_probabilities because the calling functions already did this and pytorch-grad-cam needs grad enabled.

Fixes #45

Changes classifier base class to extend nn.Module and implements the
forward() method so the classifiers can be used with pytorch-grad-cam.
torch.no_grad was removed from create_probabilities because the
calling functions already did this and pytorch-grad-cam needs grad
enabled.

Fixes #45
@johnbradley
Copy link
Collaborator Author

@Link7808 FYI on this PR.

@johnbradley
Copy link
Collaborator Author

The COLAB URL in the README points to a file that doesn't exist until this is merged. Also you will need to install pybioclip from this branch as well.
To test the notebook on COLAB use this link: https://colab.research.google.com/github/Imageomics/pybioclip/blob/gradcam/examples/GradCamExperiment.ipynb
Change the installation cell to this value:

!pip install -q git+https://github.com/imageomics/pybioclip.git@gradcam grad-cam

johnbradley added a commit that referenced this pull request Nov 21, 2024
Adds method to CustomLabelsClassifier to save class labels and
embeddings to a npy file. Adds embeddings_path parameter to
CustomLabelsClassifier to load the labels and embeddings.

This change needs to wait for this PR due to a field name change:
#64
johnbradley added a commit that referenced this pull request Nov 26, 2024
Adds method to CustomLabelsClassifier to save class labels and
embeddings to a npy file. Adds embeddings_path parameter to
CustomLabelsClassifier to load the labels and embeddings.

This change needs to wait for this PR due to a field name change:
#64

Fixes #17
Copy link
Member

@hlapp hlapp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great to me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for GradCam
2 participants