-
Notifications
You must be signed in to change notification settings - Fork 59
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
Projective transform for equivariant imaging #173
Conversation
Hey Andrew, This would be a nice contribution! I think it would be good to document all of the transforms, and add them in the documentation. I can have a look once the tests are passing! |
I am in favor of making the kornia dependency optional, especially because it is used only once, and only in case the transform is applied to tensors. @tachella what do you think ? |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #173 +/- ##
==========================================
- Coverage 76.01% 66.70% -9.32%
==========================================
Files 101 124 +23
Lines 7481 8782 +1301
Branches 1013 1264 +251
==========================================
+ Hits 5687 5858 +171
- Misses 1474 2536 +1062
- Partials 320 388 +68 ☔ View full report in Codecov by Sentry. |
How do I add it as an optional dependency? |
You can do it in the same way as bm3d for example, see deepinv/deepinv/models/bm3d.py Line 6 in 311f98e
|
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.
The PR looks great, I just found a few details in the docstrings to correct: at the moment the example snippets will not run since the :: indicator for code is not recognized by doctest.
save_folder_curve.mkdir(parents=True, exist_ok=True) | ||
|
||
if plot_images: | ||
( |
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.
why did you apply these changes?
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.
I believe that was @samuro95 ?
|
||
physics = dinv.physics.Inpainting((3, 256, 256), mask=0.6, device=device) | ||
|
||
download_and_extract_archive( |
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 please update to the Urban100HR class added in a recent PR?
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.
This increases demo runtime by ~1min as the current deepinv Urban100HR is much bigger than the HF Urban100 I'm using. I could create an issue?
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.
many thanks @Andrewwango for this PR - everything looks good to me
This PR introduces the projective transformation, or homography, an image transformation available for self-supervised learning using equivariant imaging. The transformation is implemented at
deepinv.transform.Homography
.I've also implemented a few subgroups of transformations, including
deepinv.transform.projective.Affine
,deepinv.transform.projective.Similarity
anddeepinv.transform.projective.Euclidean
transformations, which may also be useful in some use-cases.This was introduced in our recent paper Perspective-Equivariant Imaging: an Unsupervised Framework for Multispectral Pansharpening, as the homography provides a richer group of transformations and so provides better performance for equivariant imaging in camera-based imaging scenarios such as satellite imaging.
See further demos of this functionality at this webpage notebook.
Note this adds
kornia
as a dependency, but happy to make it optional dependency instead if needed.Checks to be done before submitting your PR
python3 -m pytest tests/
runs successfully.black .
runs successfully.make html
runs successfully (in thedocs/
directory).