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

Add Vaihingen Segmentation #248

Merged

Conversation

isaaccorley
Copy link
Collaborator

This PR adds the Vaihingen dataset from the WG II/4 2D Semantic Labeling Contest.

Notes:

  • I used the specified colormap found here.
  • All labels are provided but I split the dataset by filenames into the train/test sets used in the challenge.
  • The images are not georefenced but I'm reading them using rasterio and it complains that they aren't georeferenced in the tests.
  • Images are all of different sizes
  • I was able to abstract the file structure away enough that in a future PR we can make a parent class to combine the Potsdam/Vaihingen datasets or reduce copy/pasted code.

Examples:

image

@isaaccorley isaaccorley added the datasets Geospatial or benchmark datasets label Nov 16, 2021
@isaaccorley isaaccorley self-assigned this Nov 16, 2021
@adamjstewart
Copy link
Collaborator

The images are not georefenced but I'm reading them using rasterio and it complains that they aren't georeferenced in the tests.

I think that means we just need to read them with PIL instead?

Copy link
Collaborator

@adamjstewart adamjstewart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potsdam and Vaihingen seem very similar, I wonder if they belong in a single isprs.py file or something like that. I guess it depends on how many datasets ISPRS has and whether there is any logical grouping between them.

tmp.ipynb Outdated Show resolved Hide resolved
torchgeo/datasets/utils.py Show resolved Hide resolved
torchgeo/datasets/vaihingen.py Outdated Show resolved Hide resolved
@isaaccorley
Copy link
Collaborator Author

Refactored to load with PIL. Changed everywhere to Vaihingen2D.

tests/datasets/test_vaihingen.py Outdated Show resolved Hide resolved
tests/datasets/test_vaihingen.py Outdated Show resolved Hide resolved
torchgeo/datasets/vaihingen.py Outdated Show resolved Hide resolved
torchgeo/datasets/vaihingen.py Outdated Show resolved Hide resolved
isaaccorley and others added 3 commits November 16, 2021 00:38
Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
@calebrob6
Copy link
Member

RIP tmp.ipynb

@adamjstewart adamjstewart merged commit c818827 into microsoft:main Nov 16, 2021
@isaaccorley isaaccorley deleted the datasets/vaihingen-segmentation branch November 16, 2021 08:19
@adamjstewart adamjstewart added this to the 0.2.0 milestone Nov 20, 2021
@adamjstewart adamjstewart added datamodules PyTorch Lightning datamodules utilities Utilities for working with geospatial data and removed utilities Utilities for working with geospatial data labels Jan 2, 2022
yichiac pushed a commit to yichiac/torchgeo that referenced this pull request Apr 29, 2023
* tmp

* add vaihingen dataset

* add tests and dummy data

* style fixes

* remove tmp notebook

* update per suggestions

* updated docs and docstrings

* Update tests/datasets/test_vaihingen.py

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

* Update tests/datasets/test_vaihingen.py

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

* Update torchgeo/datasets/vaihingen.py

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

* Update torchgeo/datasets/vaihingen.py

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
datamodules PyTorch Lightning datamodules datasets Geospatial or benchmark datasets
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants