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

Apply postproceessing functions individually on batch items #91

Closed
surajpaib opened this issue Dec 6, 2023 · 2 comments
Closed

Apply postproceessing functions individually on batch items #91

surajpaib opened this issue Dec 6, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@surajpaib
Copy link
Collaborator

🚀 Feature Request

Currently, the postpostprocessing applies to the entire batch with [N,C,D,H,W] being passed as input. Because of that postprocessing won't support MONAI postprocessing transforms.

I suggest making it work individually on batch items so it can use monai's [C,D,H,W] supported transforms directly. I do not see any benefit in operating over a whole batch.

@surajpaib surajpaib added the enhancement New feature or request label Dec 6, 2023
@ibro45
Copy link
Collaborator

ibro45 commented Dec 7, 2023

I'm not sure if we can make sure that decollate will work in all cases. Also, would we collate them into a batch after decollated postprocessing? It could bring more issues if the applied postprocessing prevents the examples from collating (e.g., different shape). On the other hand, if we don't collate it after postprocessing, then that's a problem for the criterion, possibly for the metrics too - in the best case, it would hurt only the time it takes because you'd have to loop over individual examples in the batch. Also, we would have to rewrite how loggers and writers handle data (e.g.

def preprocess_image(image: torch.Tensor) -> torch.Tensor:
).

@surajpaib
Copy link
Collaborator Author

Nvm mind actually, I realized that this only makes sense for certain things.

I'm adding a transform myself to decollate and collate.

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

No branches or pull requests

2 participants