Skip to content

2169 Support more collate and list of data#2170

Merged
Nic-Ma merged 11 commits intoProject-MONAI:devfrom
Nic-Ma:2169-support-more-collate
May 11, 2021
Merged

2169 Support more collate and list of data#2170
Nic-Ma merged 11 commits intoProject-MONAI:devfrom
Nic-Ma:2169-support-more-collate

Conversation

@Nic-Ma
Copy link
Copy Markdown
Contributor

@Nic-Ma Nic-Ma commented May 10, 2021

Fixes #2169 .

Description

This PR added support for other collate functions in the invert logic and save a list of tensor data.

Status

Ready

Types of changes

  • Non-breaking change (fix or new feature that would not break existing functionality).
  • Breaking change (fix or new feature that would cause existing functionality to change).
  • New tests added to cover the changes.
  • Integration tests passed locally by running ./runtests.sh -f -u --net --coverage.
  • Quick tests passed locally by running ./runtests.sh --quick --unittests.
  • In-line docstrings updated.
  • Documentation updated, tested make html command in the docs/ folder.

@Nic-Ma Nic-Ma requested review from ericspod, rijobro and wyli May 10, 2021 16:29
@Nic-Ma
Copy link
Copy Markdown
Contributor Author

Nic-Ma commented May 10, 2021

Hi @rijobro ,

This PR also added more unit tests to cover the features.

Thanks.

@Nic-Ma
Copy link
Copy Markdown
Contributor Author

Nic-Ma commented May 10, 2021

/black

monai-bot and others added 2 commits May 10, 2021 16:32
@Nic-Ma
Copy link
Copy Markdown
Contributor Author

Nic-Ma commented May 10, 2021

Hi @rijobro and @ericspod ,

Could you please help review this PR? It mainly contains 2 features:
(1) add support for other collate function in Invertd,
(2) Make SaveImage transform to support a list of Tensor data.
Our internal team needs invert feature in their workflows without ignite.

Thanks in advance.

@Nic-Ma Nic-Ma requested a review from yiheng-wang-nv May 10, 2021 23:35
@Nic-Ma Nic-Ma force-pushed the 2169-support-more-collate branch from 1b2383b to ddb9a5c Compare May 11, 2021 00:06
@Nic-Ma Nic-Ma force-pushed the 2169-support-more-collate branch from 68016f7 to 7a05a16 Compare May 11, 2021 06:28
@Nic-Ma
Copy link
Copy Markdown
Contributor Author

Nic-Ma commented May 11, 2021

/black

@Nic-Ma Nic-Ma merged commit 6af86bc into Project-MONAI:dev May 11, 2021
collate_fn: how to collate data after inverse transformations.
default won't do any collation, so the output will be a list of size batch size.
collate_fn: how to collate data after inverse transformations. default won't do any collation,
so the output will be a list of PyTorch Tensor or numpy array without batch dim.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
so the output will be a list of PyTorch Tensor or numpy array without batch dim.
so the output will be a list of length `batch`, each element consisting of PyTorch Tensor or numpy array without batch dim.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sorry @Nic-Ma was a bit late with the review. PR looks good and this suggested documentation change is trivial.

yanielc pushed a commit to yanielc/MONAI that referenced this pull request May 13, 2021
* [DLMED] enhance Invertd and SaveImage

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] add more test

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] remove unwanted files

Signed-off-by: Nic Ma <[email protected]>

* [MONAI] python code formatting

Signed-off-by: monai-bot <[email protected]>

* [DLMED] fix flake8 issue

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] enhance doc-string

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] update according to comments

Signed-off-by: Nic Ma <[email protected]>

Co-authored-by: monai-bot <[email protected]>
Signed-off-by: Yaniel Cabrera <[email protected]>
yanielc pushed a commit to yanielc/MONAI that referenced this pull request May 13, 2021
* [DLMED] enhance Invertd and SaveImage

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] add more test

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] remove unwanted files

Signed-off-by: Nic Ma <[email protected]>

* [MONAI] python code formatting

Signed-off-by: monai-bot <[email protected]>

* [DLMED] fix flake8 issue

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] enhance doc-string

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] update according to comments

Signed-off-by: Nic Ma <[email protected]>

Co-authored-by: monai-bot <[email protected]>
Signed-off-by: Yaniel Cabrera <[email protected]>
@Nic-Ma Nic-Ma deleted the 2169-support-more-collate branch July 2, 2021 23:36
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.

TransformInverter has collate arg but can't work

4 participants