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

Inference Updates #405

Merged
merged 11 commits into from
Jul 19, 2024
Merged

Conversation

benjijamorris
Copy link
Contributor

@benjijamorris benjijamorris commented Jul 10, 2024

What does this PR do?

  • add callback template for saving model features as a csv
  • rework czi dataloader to work for multidim images (timelapse, multiscene, etc.)
  • Add option to pass dict to multidim dataset instead of a csv
  • add feature-only inference option for MAE models

Before submitting

  • Did you make sure title is self-explanatory and the description concisely explains the PR?
  • Did you make sure your PR does only one thing, instead of bundling different changes together?
  • Did you list all the breaking changes introduced by this pull request?
  • Did you test your PR locally with pytest command?
  • Did you run pre-commit hooks with pre-commit run -a command?

Did you have fun?

Make sure you had fun coding 🙃

ritvikvasan
ritvikvasan previously approved these changes Jul 16, 2024
Copy link
Member

@ritvikvasan ritvikvasan left a comment

Choose a reason for hiding this comment

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

sweet!

"""Function to create a CZI Dataset. Currently, this dataset is only useful during prediction
and cannot be used for training or testing.
) -> DataLoader:
"""Function to create a MultiDimImage Dataset. Currently, this dataset is only useful during
Copy link
Member

Choose a reason for hiding this comment

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

create a data loader?

@@ -290,5 +295,7 @@ def __init__(

def forward(self, img):
features, mask, forward_indexes, backward_indexes = self.encoder(img, self.mask_ratio)
if self.features_only:
Copy link
Member

Choose a reason for hiding this comment

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

if features_only mask_ratio must be 0?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't want to enforce that in case we want to pass in a mask and just look at features from that subset of tokens (wishful thinking for now, but that's the reason behind that choice)

@benjijamorris benjijamorris merged commit c65dbbf into main Jul 19, 2024
1 check passed
@benjijamorris benjijamorris deleted the feature/timelapse_inference_dataloader branch July 19, 2024 18:59
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.

2 participants