torchgeo icon indicating copy to clipboard operation
torchgeo copied to clipboard

GridGeoSampler on areas smaller than patch size

Open mpelchat04 opened this issue 1 year ago • 0 comments

Discussed in https://github.com/microsoft/torchgeo/discussions/1624

Originally posted by mpelchat04 October 5, 2023 We use the GridGeoSampler to create patches. Although, we have cases where the portion covered by the training data is small (smaller than patch_size), as seen in pink in the image:
bcf04b15-c161-45de-b9f8-d2e60ca1f8c4 The image and data showed here are taken from the Spacenet-7 dataset.
Using the GridGeoSampler, these patches are discarded and it seems like an intended feature ref.
Is there a logical way to overcome this limitation, where it discards useful patches?

Intended behavior is up for discussion:

Suggestion: The minimum value of the intersection bounds could be the patch_size X patch_size. Q1: What if the area of intersection is 0? A: Then no need to have a sampler. Q2: What if we're using a point dataset? A: What is the result of the intersection between a single point and an image tile?
Q3: What if the image tile is also smaller than patch_size?

mpelchat04 avatar Oct 06 '23 17:10 mpelchat04