-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Meta tensor load image #4130
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
Meta tensor load image #4130
Conversation
Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com>
Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com>
Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com>
1d57add to
6c4c3d0
Compare
Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com>
6c4c3d0 to
f9fd14a
Compare
Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com>
78728d2 to
b227fdd
Compare
Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com>
Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com>
Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com>
Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com>
Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com>
Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com>
|
@Nic-Ma @ericspod @wyli |
Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com>
ericspod
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, I have a few optional suggestions.
|
Hi @rijobro, branches with the name pattern MONAI/.github/workflows/setupapp.yml Line 9 in 641a079
after this PR, I'll rename this MetaTensor branch to feature/MetaTensor to benefit from this...
|
Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com>
Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com>
|
@wyli Any idea what's going wrong with the checks? Some jobs are failing before starting with: |
it's a known NGC issue and the team is working on it, (https://forums.developer.nvidia.com/t/invalid-public-key-for-cuda-apt-repository/212901) |
|
for the record for more tests, after this PR I'll
(we also need a torch_function benchmark such as: https://github.com/pytorch/pytorch/tree/c371542efc31b1abfe6f388042aa3ab0cef935f2/benchmarks/overrides_benchmark |
Signed-off-by: Wenqi Li <wenqil@nvidia.com>
Signed-off-by: Wenqi Li <wenqil@nvidia.com>
|
/build |
Signed-off-by: Wenqi Li <wenqil@nvidia.com>
|
|
||
| def __repr__(self) -> str: | ||
| """String representation of class.""" | ||
| out: str = super().__repr__() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this line should be reverted, I think the output should be the same as torch.Tensor, but with the extra metadata (now we have metadata instead of voxel data). @wyli what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, please feel free to change, the corresponding test case is this line:
MONAI/tests/test_meta_tensor.py
Line 201 in 18fca88
| self.assertTrue(str(out).startswith("\nMetaData")) |
* collate , decollate, dataset, dataloader, out= Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com> * mypy Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com> * skip decollation for pytorch 1.7 Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com> * fix Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com> * fix Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com> * add batch index testing Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com> * fixes Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com> * fix Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com> * fix Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com> * fix Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com> * fix Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com> * load image meta tensor Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com> * splitdims fix Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com> * flake8 Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com> * fix test_nifti_rw Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com> * test_smartcachedataset Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com> * test fixes Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com> * test fixes Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com> * fix Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com> * fixes Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com> * fix Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com> * fixes Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com> * fix wsi test Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com> * changes after code review Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com> Signed-off-by: Wenqi Li <wenqil@nvidia.com>
This shows how I would propose to modify
LoadImageto deal withMetaTensor.This caused a lot of errors throughout our codebase, which I solved with
FromMetaTensordwherever necessary.This is a temporary fix and the usages of
FromMetaTensordwill be deleted as other parts of the codebase are updated to be compatible withMetaTensor.This is a breaking change, so the PR is to
MONAI/MetaTensorinstead ofdev.Status
Ready
Types of changes