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

Adding support for pyramids #129

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Adding support for pyramids #129

wants to merge 4 commits into from

Conversation

edyoshikun
Copy link
Contributor

@edyoshikun edyoshikun commented Aug 8, 2024

This PR adds the support for pyramids to address #125. This modifies the HCSDataloader()

viscy/data/hcs.py Outdated Show resolved Hide resolved
@mattersoflight
Copy link
Member

@edyoshikun thanks - this implementation seems backward compatible with previous configs for training and prediction for virtual staining and contrastive learning tasks. Can you check with the configs we are sharing with the preprint if they need any change (e.g., explicitly setting the scale = 0)?

@ziw-liu ziw-liu added the enhancement New feature or request label Aug 15, 2024
@edyoshikun
Copy link
Contributor Author

@mattersoflight we don't need to change the previous configs because by default the Dataloader will be set to "0" the highest resolution if the parameter is not provided in the config.

For the preprint, I thought we were pointing them to viscy=0.2.0, which may or may not have this PR. If we are adding this PR as part of 0.2.0, I'll make the changes.

@talonchandler
Copy link
Contributor

I've tested the basic HCSDataModule with multiple resolution levels, and it's working well. I can load random patches at any resolution level in my pyramid. Thanks @edyoshikun.

@edyoshikun I'm happy to leave this as a branch while we test this out end to end during the course.

@@ -104,6 +104,8 @@ class SlidingWindowDataset(Dataset):
:param ChannelMap channels: source and target channel names,
e.g. ``{'source': 'Phase', 'target': ['Nuclei', 'Membrane']}``
:param int z_window_size: Z window size of the 2.5D U-Net, 1 for 2D
:param str pyramid_resolution: pyramid level.
defaults to 0 (full resolution)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
defaults to 0 (full resolution)
defaults to "0" (full resolution)

@ziw-liu
Copy link
Collaborator

ziw-liu commented Sep 11, 2024

The code changes look good, but we should test that training actually works before merging.

@ziw-liu ziw-liu added the translation Image translation (VS) label Sep 11, 2024
@ziw-liu ziw-liu linked an issue Sep 11, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request translation Image translation (VS)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support loading data from a specific resolution of a .zarr pyramid
4 participants