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 plot functions to datasets #251

Merged
merged 16 commits into from
Nov 19, 2021
Merged

Add plot functions to datasets #251

merged 16 commits into from
Nov 19, 2021

Conversation

calebrob6
Copy link
Member

@calebrob6 calebrob6 commented Nov 19, 2021

Working on adding/fixing plot functions for the datasets that don't have them.

Currently on my list

  • EuroSAT
  • LandCoverAI
  • RESISC45
  • SeCo
  • So2Sat
  • UCMerced

@calebrob6
Copy link
Member Author

Landcover.ai examples

image
image

@calebrob6
Copy link
Member Author

EuroSAT

image

@calebrob6
Copy link
Member Author

RESISC45

image

@calebrob6
Copy link
Member Author

calebrob6 commented Nov 19, 2021

@adamjstewart sphinx is failing in the EuroSAT plot function docstring because it can't find the __getitem__ method in the parent class. Have you run into this / do you have ideas?

(also, this will be a rare case where I want to do some preliminary refactoring before having all the initial code out there -- don't worry that the RESISC45 and EuroSAT plot methods are identical!)

@adamjstewart
Copy link
Collaborator

(also, this will be a rare case where I want to do some preliminary refactoring before having all the initial code out there -- don't worry that the RESISC45 and EuroSAT plot methods are identical!)

I'm actually fine with having similar/same plot methods across datasets. I initially made a single plot method for GeoDataset but I think I want to undo this. Things like normalization are so different across datasets that it makes sense to have dataset-specific methods.

@adamjstewart
Copy link
Collaborator

@adamjstewart sphinx is failing in the EuroSAT plot function docstring because it can't find the __getitem__ method in the parent class. Have you run into this / do you have ideas?

I think you just need to tell it where __getitem__ is defined, so use VisionClassificationDataset.__getitem__ instead.

@adamjstewart adamjstewart added the datasets Geospatial or benchmark datasets label Nov 19, 2021
@calebrob6
Copy link
Member Author

Awesome, thanks!

@calebrob6
Copy link
Member Author

So2Sat

image
image

@calebrob6
Copy link
Member Author

UCMerced

image
image

@calebrob6
Copy link
Member Author

SeCo

image
image

@adamjstewart adamjstewart merged commit 248cd4a into main Nov 19, 2021
@adamjstewart adamjstewart deleted the plotting branch November 19, 2021 22:28
@adamjstewart adamjstewart added this to the 0.2.0 milestone Nov 20, 2021
@adamjstewart
Copy link
Collaborator

I'm seeing the following warning when running the tests:

tests/datasets/test_so2sat.py::TestSo2Sat::test_plot[train]
tests/datasets/test_so2sat.py::TestSo2Sat::test_plot[validation]
tests/datasets/test_so2sat.py::TestSo2Sat::test_plot[test]
  D:\a\torchgeo\torchgeo\torchgeo\datasets\utils.py:569: RuntimeWarning: invalid value encountered in true_divide
    (img - lower_percentile) / (upper_percentile - lower_percentile), 0, 1

I think the So2Sat fake data needs to be updated so that it isn't all zeros and instead contains a range or random numbers.

@adamjstewart adamjstewart added 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
* Adding plot function for EuroSAT

* Added LandCover.ai plot

* Cleaning up

* Added method for percentile normalization

* Adding RESISC45 plot

* Adding versionadded tags and fixing docs

* So2Sat should return tensor labels

* Added So2Sat plot

* Added UCMerced plot

* Changed percentile normalization to calculate values overall and not by band

* Added SeCo plot

* Fixed So2Sat doc

* Adding version to xview2

* Testing percentile_normalization

* Style in test_utils

* version de-added
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 this pull request may close these issues.

2 participants