ExtractTensorPatches for Masks in AugmentationSequential
See original GitHub issue🚀 Feature
Modify kornia.contrib.ExtractTensorPatches
to apply the same operation to masks in AugmentationSequential
.
Motivation
In remote sensing it’s common to work with imagery which can be relatively large in shape (e.g. 3000x3000+). Therefore during training images are broken into patches. For segmentation tasks it’s needed to apply the same patch extract operation to both images and masks.
Pitch
Modify kornia.contrib.ExtractTensorPatches
to apply the same operation to masks in AugmentationSequential
.
Alternatives
If there is a better way to chain augmentations and ExtractTensorPatches
please provide suggestions.
Additional context
import torch
import kornia.augmentation as K
from kornia.contrib import ExtractTensorPatches
image = torch.randn(2, 3, 128, 128)
mask = torch.randn(2, 1, 128, 128)
augs = K.AugmentationSequential(
K.ColorJitter(0.1, 0.1, 0.1, 0.1, p=1.0),
K.RandomAffine(360, p=1.0),
ExtractTensorPatches(window_size=32, stride=32, padding=0),
data_keys=["input", "mask"]
)
image, mask = augs(image, mask)
# NotImplementedError: data_key DataKey.MASK is not implemented for ExtractTensorPatches().
Issue Analytics
- State:
- Created 2 years ago
- Comments:12 (7 by maintainers)
Top Results From Across the Web
kornia.augmentation.container.augment - Read the Docs
[docs]class AugmentationSequential(ImageSequential): r"""AugmentationSequential for handling multiple input types like inputs, masks, keypoints at once.
Read more >Masks: COVID-19 - MN Dept. of Health
The masking recommendations below include these CDC considerations and additional MDH considerations for people who are immunocompromised or at higher risk of ...
Read more >Issues-kornia/kornia - PythonTechWorld
ExtractTensorPatches to apply the same operation to masks in AugmentationSequential. Motivation In remote sensing it's common to work with imagery which can ...
Read more >Wearing Masks in Travel and Public Transportation Settings
Wearing a high-quality mask or respirator is most beneficial in crowded or poorly ventilated locations, such as airport jetways. CDC also encourages operators ......
Read more >kornia - bytemeta
ExtractTensorPatches for Masks in AugmentationSequential. isaaccorley. isaaccorley CLOSED · Updated 1 year ago · Inverse of Extract Tensor Patches. lyhyl.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @isaaccorley, please checkout #1347.
Then, the required operation can be implemented as
Please comment on the PR if any 😃
I think lambda makes sense here and helps support chaining other general ops in a AugmentationSequential container.