-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
Is your feature request related to a problem? Please describe.
GridPatchDataset'sdataargument must be a sequence of already loaded data. However, it would be consistent with other datasets to allow loading and manipulating other types of data throughtransform. For example, you might want to provide a dict of image and label paths and load them through transforms usingLoadImaged().PatchDatasetshould follow the same. Moreover, it has atransformargument that is actually the same aspatch_transforminGridPatchDataset, so it should follow that naming.- Finally, it would be useful to have Persistent or Cache versions of these (or just any
IterableDataset) - is that something that you would want to have?
Describe the solution you'd like
GridPatchDatasetcurrently haspatch_transform, but should have two transforms:transformandpatch_transform. Thetransformis to be used the same as in the IterableDataset and is applied prior to patching, whilepatch_transformis applied to the patch.PatchDatasetshould follow the same.
Describe alternatives you've considered
None
Additional context
I started looking into these patch-based datasets because I want to perform validation on large images during my training. Specifically, images are sometimes too big to perform SlidingWindowInferer on GPU, and using cpu_thresh just results in a very long computation. I hope to use this as a replacement for it, and it should be way faster if Persistent/Cache mode is available too. It basically emulates sliding window inference - still allows you to split into patches with some overlap and pass them through the network to get the prediction, but with a caveat that the predicted patches are never merged and instead evaluated against the corresponding label patches individually.
I am happy to make a PR for the first two points. I am also interested in implementing the third point if you agree with it and if we discuss how we should approach it.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status