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

Elastic 3d #79

Merged
merged 7 commits into from
Jul 25, 2022
Merged

Elastic 3d #79

merged 7 commits into from
Jul 25, 2022

Conversation

Buglakova
Copy link
Contributor

Add 3D elastic deformation by applying the same x-y deformation field to each z slice. padding_mode="reflection" to avoid strange border effects like here:
elastic3D_borders

The same deformation is applied to each sample in batch.

@constantinpape
Copy link
Owner

Cool! I will take a closer look tomorrow :).

Copy link
Owner

@constantinpape constantinpape left a comment

Choose a reason for hiding this comment

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

I had a look at this now and the changes and results of the augmentation look good!
I would just suggest to change the name, since it's not a real 3d elastic augmentation (in the sense of applying a 3d warp field).
I went ahead and pushed a few more changes to reactivate the normal 2d augmentation as well.
(I also realized that we will need tests for this; bit since there aren't any yet let's go ahead with this PR as it is and we can then add tests later.)

@@ -6,7 +6,67 @@
from ..util import ensure_tensor


# TODO RandomElastic3D ?
class RandomElasticDeformation3D(kornia.augmentation.AugmentationBase3D):
Copy link
Owner

Choose a reason for hiding this comment

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

The name is a bit misleading. I would assume that RandomElasticDeformation3D applies real 3d deformations. Maybe rename to RandomElasticDeformationStacked.

Copy link
Owner

Choose a reason for hiding this comment

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

I went ahead and renamed it.

@constantinpape constantinpape merged commit 88616f4 into constantinpape:main Jul 25, 2022
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.

None yet

2 participants