-
Notifications
You must be signed in to change notification settings - Fork 408
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
UCMerced: fix image shape bug #1238
UCMerced: fix image shape bug #1238
Conversation
literally just ran into this
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you change the fake data for UC Merced to reflect the fact that the image size isn't consistent? This will let us test things properly.
Something seems to be wrong with the tests because the test data does vary in size already
|
Ok I figured it out. It's because in the datamodule inside the test config we are using a |
72af489
to
38e3952
Compare
Is it worth resizing in the dataset instead of the datamodule? |
Good point. I think keeping this in the datamodule is better because it doesn't make any assumptions about how the user wants to modify the dataset. |
I guess the benefit of doing it in the dataset is that users who use the dataset without a datamodule won't also have to do this. Are all the images approximately the same size? Looking at our existing code, we have 2 datasets (cyclone, seco) and 0 datamodules that do resizing, unless I miscounted. |
Yes they are all within a few pixels from 256x256. I'm good either way so I'll leave it up to you, just let me know so I can implement it. |
I like it in the dataset so users don't have to fool around with it. Without it someone (me) is going to do:
then get the error about size mismatch, groan, go lookup how to do resize and pass that as a transform, and continue with whatever they were doing. |
…orchgeo into datasets/ucmerced-size-bug
38e3952
to
7cbef78
Compare
Co-authored-by: Adam J. Stewart <[email protected]>
…orchgeo into datasets/ucmerced-size-bug
4690751
to
8866b22
Compare
Something wrong with the pyvista docs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to rebase now that we are using Python 3.9+ type hints
* fix resize bug in ucmerced * remove unused test * update tests * move resize to dataset * fix resize bug in ucmerced * remove unused test * update tests * remove changes to datamodule * Update torchgeo/datasets/ucmerced.py Co-authored-by: Adam J. Stewart <[email protected]> * fix docstring * fix resize bug in ucmerced * remove unused test * update tests * move resize to dataset * fix resize bug in ucmerced * remove unused test * update tests * remove changes to datamodule * Update torchgeo/datasets/ucmerced.py Co-authored-by: Adam J. Stewart <[email protected]> * fix docstring * update docstring * update docstring x3 * remove Dict * remove Tuple * Fix base class docs * Grammar fix --------- Co-authored-by: Adam J. Stewart <[email protected]>
Previously we performed some preprocessing transforms for each individual sample. In #992 we changed this to perform all transforms on a batch.
However, some of the UCMerced images vary in size, e.g. 247, 254, 248. This causes an issue when loading batches of the imagery because they aren't the same shape and aren't being resized. This PR adds a default resize transform so that if a user doesn't specify the transform as a kwarg, the dataset will still work with a dataloader.