Skip to content

Issue with GridGeoSampler in Windows 11 #2714

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

Open
FatemehEsfahani opened this issue Apr 10, 2025 · 6 comments
Open

Issue with GridGeoSampler in Windows 11 #2714

FatemehEsfahani opened this issue Apr 10, 2025 · 6 comments
Labels
samplers Samplers for indexing datasets

Comments

@FatemehEsfahani
Copy link

Description

I want to use GridGeosampler in Windows 11: sampler = GridGeoSampler(resulting_dataset, size=128, stride=128). However, nothing is produced. The length of sampler is zero.

Steps to reproduce

This is the bounding box of my resulting_dataset:
BoundingBox(minx=-120.03357866990702, maxx=-120.01546172995442, miny=49.703449529631186, maxy=49.71845099117338, mint=0.0, maxt=9.223372036854776e+18)
sampler = GridGeoSampler(resulting_dataset, size=128, stride=128)

Version

NA

@adamjstewart
Copy link
Collaborator

Difficult to reproduce without data or code. What's the image resolution?

@FatemehEsfahani
Copy link
Author

Resolution is 30 meters

Difficult to reproduce without data or code. What's the image resolution?

@adamjstewart
Copy link
Collaborator

What's the resolution in the same units as the CRS? It appears to be in degrees. I'm trying to figure out how many 128x128 px patches should fit in your image.

@FatemehEsfahani
Copy link
Author

What's the resolution in the same units as the CRS? It appears to be in degrees. I'm trying to figure out how many 128x128 px patches should fit in your image.

It is 0.00026949458523585647. CRS is EPSG:4326. I think the area is too small to samle from. So, in this case which sampler should we use to do padding if the area is small?

@adamjstewart
Copy link
Collaborator

So if I did my math correctly, you have approximately a single 56 x 67 px image? In that case, you don't really need a sampler at all, do you? You could just use:

sample = dataset[dataset.bounds]

to load the only image. You could also manually calculate a larger bounding box if you want to automatically pad to 128 x 128 px. Note that thousands of images are required to train a model, but you can still do inference on a single image if you already have a trained model.

@adamjstewart adamjstewart added the samplers Samplers for indexing datasets label Apr 11, 2025
@FatemehEsfahani
Copy link
Author

So if I did my math correctly, you have approximately a single 56 x 67 px image? In that case, you don't really need a sampler at all, do you? You could just use:

sample = dataset[dataset.bounds]
to load the only image. You could also manually calculate a larger bounding box if you want to automatically pad to 128 x 128 px. Note that thousands of images are required to train a model, but you can still do inference on a single image if you already have a trained model.

I see. Thank you for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
samplers Samplers for indexing datasets
Projects
None yet
Development

No branches or pull requests

2 participants