Inverse of Extract Tensor Patches
See original GitHub issue🚀 Feature
A kornia.contrib.CombineTensorPatches
module which performs the inverse of kornia.contrib.ExtractTensorPatches
Motivation
In remote sensing it’s common to work with imagery which can be relatively large in shape (e.g. 3000x3000+). Therefore during training/inference images are broken into patches. After feeding to the model, it’s necessary to combine the patches back to a single image.
Pitch
A kornia.contrib.CombineTensorPatches
which performs the inverse of kornia.contrib.ExtractTensorPatches
, assuming a stride of 1 the same as the window size.
Alternatives
We could implement this functionality in our own library, however we feel that it is general-purpose enough to belong in Kornia.
Additional context
I implemented something similar here although using einops
and with some custom pieces for handling our data structures.
We would like to use such functionality in torchgeo
, a PyTorch domain library for geospatial data - https://github.com/microsoft/torchgeo.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:5 (4 by maintainers)
Top GitHub Comments
@isaaccorley feel free to give it a shoot with a PR
@shijianjian can we close this?