Skip to content
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

Wrong band order in EuroSAT dataset #2458

Closed
lhackel-tub opened this issue Dec 9, 2024 · 3 comments · Fixed by #2480
Closed

Wrong band order in EuroSAT dataset #2458

lhackel-tub opened this issue Dec 9, 2024 · 3 comments · Fixed by #2480
Labels
datasets Geospatial or benchmark datasets

Comments

@lhackel-tub
Copy link
Contributor

Description

Hello,

During the loading of the EuroSAT dataset, the band order with [..., B08, B8A, B09, ...] as described here is assumed. However, in the original EuroSAT repository, this issue was raised regarding the band order and accepted by the original authors, which describes the Bandorder as [..., B08, B09, ..., B12, B8A]. I was therefore wondering if this might be a mistake in torchgeo that assumes a different band order or if there is any additional information available that shows that the original repository's assumption is incorrect.

Thanks!

Steps to reproduce

No code needed

Version

0.6.1

@adamjstewart adamjstewart added the datasets Geospatial or benchmark datasets label Dec 9, 2024
@adamjstewart
Copy link
Collaborator

Thanks for pointing this out! I ended up taking a deep dive to try to find the answer.

Things that suggest that B8A is in the 9th spot:

Things that suggest that B8A is in the 13th spot:

  • The issue you linked to (although it wasn't answered by the EuroSAT developers, it was closed without disagreement by a EuroSAT developer)
  • When I open a file in QGIS and compare the individual bands, the 9th band seems like it has 60m resolution, which is true of B9, not B8A
  • The range of values for the 10th band is completely different for all other bands, which is true for B10 (cirrus), not B9 (water vapor)

I think you're probably right. Want to open a PR to fix this? There are at least a few places that need to be fixed:

  • torchgeo/datasets/eurosat.py: simply change the order of all_bands
  • torchgeo/datamodules/eurosat.py: the normalization values are in the correct order, but the band name keys are not
  • docs/tutorials/transforms.ipynb: simply change the order of bands

There's a good chance this inconsistency exists in other datasets as well. If someone has time, it would be interesting to check all Sentinel-2 datasets.

@adamjstewart adamjstewart added this to the 0.6.2 milestone Dec 17, 2024
@adamjstewart
Copy link
Collaborator

@lhackel-tub do you want to submit a PR to fix this or would you like one of us to fix this?

@lhackel-tub
Copy link
Contributor Author

@adamjstewart I created a pull request to fix the above mentioned issues. I did not look at the other Sentinel-2 datasets.

@adamjstewart adamjstewart removed this from the 0.6.2 milestone Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
datasets Geospatial or benchmark datasets
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants