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

Remove AugPipe #1978

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

Remove AugPipe #1978

wants to merge 9 commits into from

Conversation

ashnair1
Copy link
Collaborator

@ashnair1 ashnair1 commented Apr 3, 2024

The next version of kornia (0.7.3) will contain 2 fixes (kornia/kornia#2846, kornia/kornia#2856) that will allow us to drop AugPipe and have detection only depend on kornia's AugmentationSequential.

@github-actions github-actions bot added datasets Geospatial or benchmark datasets testing Continuous integration testing trainers PyTorch Lightning trainers datamodules PyTorch Lightning datamodules labels Apr 3, 2024
@adamjstewart
Copy link
Collaborator

How close are we to also removing our custom AugmentationSequential wrapper?

@ashnair1
Copy link
Collaborator Author

ashnair1 commented Apr 3, 2024

How close are we to also removing our custom AugmentationSequential wrapper?

Pretty close actually. If kornia==0.7.3 is released soon, we should be able to fully remove it by next release.

@robmarkcole
Copy link
Contributor

@adamjstewart
Copy link
Collaborator

@ashnair1 is this waiting on kornia 0.7.4 for something?

@ashnair1
Copy link
Collaborator Author

Yeah #2147 needs to be merged before this and that needs kornia 0.7.4.

@adamjstewart adamjstewart modified the milestones: 0.6.0, 0.7.0 Aug 21, 2024
@robmarkcole
Copy link
Contributor

Note: 0.7.4 will be released by the end of September

@ashnair1 ashnair1 force-pushed the aug-remove branch 3 times, most recently from 2d281ce to d60d6fb Compare November 9, 2024 19:09
@calebrob6
Copy link
Member

This is good to go forward now

@adamjstewart
Copy link
Collaborator

adamjstewart commented Dec 27, 2024

Drop in coverage is due to some lines in our AugmentationSequential wrapper that are no longer hit. Can we just delete this wrapper now, or are we using it somewhere else? Ideally we would add some simple tests and deprecate it so as not to confuse too many people in the next release.

@github-actions github-actions bot added the transforms Data augmentation transforms label Dec 27, 2024
@ashnair1
Copy link
Collaborator Author

ashnair1 commented Dec 27, 2024

Drop in coverage is due to some lines in our AugmentationSequential wrapper that are no longer hit. Can we just delete this wrapper now, or are we using it somewhere else? Ideally we would add some simple tests and deprecate it so as not to confuse too many people in the next release.

No, the AugmentationSequential wrapper can be removed in this PR. I just needed to update tests to see if they were working as expected.

Have removed _ExtractPatches since kornia's ExtractTensorPatches works just as well.

@ashnair1 ashnair1 changed the title Remove AugPipe Remove AugPipe and AugmentationSequential wrapper Dec 27, 2024
@ashnair1
Copy link
Collaborator Author

Scoping this back to just removing AugPipe. AugmentationSequential can't be removed yet as _ExtractPatches doesn't work correctly with kornia's AugmentationSequential.

@isaaccorley
Copy link
Collaborator

@adamjstewart Do we want to remove _ExtractPatches and I can make a PR in kornia for an ExtractTensorPatches augmentation? Pinging @edgarriba for awareness.

@edgarriba
Copy link

@isaaccorley sounds good to me. Feel free to join our discourse to chat about it: https://discord.gg/Vf3QgRq2 @johnnv1

@adamjstewart
Copy link
Collaborator

I would like to remove everything in torchgeo/transforms/transforms.py sooner rather than later. So yes, anything anyone is willing to upstream I would be happy to help review. In particular, I'm also interested in upstreaming RandomNCrop. We noticed a bug in it when using data with a time dimension so we just need to fix that.

@isaaccorley
Copy link
Collaborator

Then yes sorry @ashnair1, let's remove AugmentationSequential and _ExtractPatches

@adamjstewart
Copy link
Collaborator

Or deprecate. It may take a while for upstream to make a new release.

@ashnair1
Copy link
Collaborator Author

ashnair1 commented Dec 29, 2024

Or deprecate. It may take a while for upstream to make a new release.

I think it might be better to keep the current scope of the PR as is i.e. removal of AugPipe. Deprecation can be done in #2396 right?

torchgeo/trainers/detection.py Outdated Show resolved Hide resolved
tests/datasets/test_vhr10.py Outdated Show resolved Hide resolved
tests/datasets/test_vhr10.py Outdated Show resolved Hide resolved
@ashnair1 ashnair1 force-pushed the aug-remove branch 2 times, most recently from d4ab488 to cdcf552 Compare January 4, 2025 19:53
@adamjstewart adamjstewart added the backwards-incompatible Changes that are not backwards compatible label Jan 6, 2025
adamjstewart
adamjstewart previously approved these changes Jan 6, 2025
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.

One minor undo and then I think this is ready to merge!

torchgeo/datasets/zuericrop.py Outdated Show resolved Hide resolved
@ashnair1 ashnair1 requested a review from adamjstewart January 6, 2025 11:44
@ashnair1 ashnair1 requested a review from isaaccorley January 6, 2025 12:16
@adamjstewart
Copy link
Collaborator

Drop in coverage is for AugmentationSequential: https://app.codecov.io/gh/microsoft/torchgeo/pull/1978/blob/torchgeo/transforms/transforms.py

Can you add a couple tests?

@adamjstewart
Copy link
Collaborator

Alternatively, convert our AugmentationSequential to an alias of Kornia's so you don't need to add any tests. Or I can do that in my PR, but my PR can't be merged without this PR.

@ashnair1
Copy link
Collaborator Author

ashnair1 commented Jan 6, 2025

Making our AugmentationSequential an alias for kornia's won't work as _ExtractPatches won't work with it. It would have to be removed. Refer to #1978 (comment).

@adamjstewart
Copy link
Collaborator

Ah right. So we have to figure out how to fix or replace _ExtractPatches before either of our PRs can be merged 😢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backwards-incompatible Changes that are not backwards compatible datamodules PyTorch Lightning datamodules datasets Geospatial or benchmark datasets testing Continuous integration testing trainers PyTorch Lightning trainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants