Skip to content

Sampling from disparate ROIs? #2201

Answered by adamjstewart
kvenkman asked this question in Q&A
Discussion options

You must be logged in to vote

Multiple ways actually!

If you don't care about exactly which cells get assigned where, the easiest solution is torchgeo.datasets.random_grid_cell_assignment. Note that this acts on a single tile at a time, not on the entire area of the dataset. We should probably think about adding something that does the latter (@pmandiola any interest?)

If you do care, and G&I must be in validation, but you do know the bounds for each cell in advance, then you can use torchgeo.datasets.roi_split instead. You can pass in ROIs for A-F, G, H, and I. Then you can compute the union of A-F and H, and the union of G and I, and you'll end up with exactly what you're looking for.

Hope this helps! And feel free …

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by kvenkman
Comment options

You must be logged in to vote
1 reply
@adamjstewart
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
datasets Geospatial or benchmark datasets
2 participants