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

Suggestions for regression-based 3D attention #18

Open
sgbaird opened this issue Nov 11, 2021 · 3 comments
Open

Suggestions for regression-based 3D attention #18

sgbaird opened this issue Nov 11, 2021 · 3 comments

Comments

@sgbaird
Copy link

sgbaird commented Nov 11, 2021

Any alternative codebases that might help out with regression? (instead of classification/segmentation).

@ravikiranrao
Copy link

@sgbaird Did you get anything? I am looking for regression for Video input (Batch_size, time_frames, Height, Width, Channels).

@sgbaird
Copy link
Author

sgbaird commented Nov 24, 2021

@ravikiranrao not yet, I think we're going to try a fully connected neural network to change the shape to 2D (and use PyTorch's built-in), but if we find something I'll try to remember to post back here.

@Karol-G
Copy link
Collaborator

Karol-G commented Nov 25, 2021

Hi,

sorry for the late answer. M3D-Cam is designed for segmentation and classification, but it should also be adaptable to regression. Maybe it works out-of-the-box, but I have not tested that. However, you probably need to adapt some parts of the postprocessing in medcam_inject.py.
Best would be for you to just try the default usage and work yourself up from that in case of errors.
However, I won't be able to help you with that (if you try it) as I don't really have time currently.

# Import M3d-CAM
from medcam import medcam

# Init your model and dataloader
model = MyCNN()
data_loader = DataLoader(dataset, batch_size=1, shuffle=False)

# Inject model with M3d-CAM
model = medcam.inject(model, output_dir="attention_maps", save_maps=True)

# Continue to do what you're doing...
# In this case inference on some new data
model.eval()
for batch in data_loader:
    # Every time forward is called, attention maps will be generated and saved in the directory "attention_maps"
    output = model(batch)
    # more of your code...

Best
Karol

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

No branches or pull requests

3 participants