-
Notifications
You must be signed in to change notification settings - Fork 116
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
[Features] : add flow1d correlation and correlation lookup #213
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportBase: 69.10% // Head: 70.27% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #213 +/- ##
==========================================
+ Coverage 69.10% 70.27% +1.17%
==========================================
Files 93 96 +3
Lines 5195 5467 +272
Branches 741 720 -21
==========================================
+ Hits 3590 3842 +252
- Misses 1491 1500 +9
- Partials 114 125 +11
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
mmflow/models/utils/correlation1d.py
Outdated
self, | ||
feat1: Tensor, | ||
feat2_x: Tensor, | ||
feat2_y: Tensor, |
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.
feat2_y: Tensor, | |
feat2_y: Tensor |
mmflow/models/utils/correlation1d.py
Outdated
corr = corr.permute(0, 2, 1, 3).contiguous().view(b, h, w, 1, h, 1) | ||
corr = corr / scale_factor | ||
corr = corr.flatten(0, 2) |
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.
corr = corr.permute(0, 2, 1, 3).contiguous().view(b, h, w, 1, h, 1) | |
corr = corr / scale_factor | |
corr = corr.flatten(0, 2) | |
corr = corr.view(-1, 1, h, 1) / scale_factor |
mmflow/ops/corr_lookup.py
Outdated
concatenate together. | ||
""" | ||
B, _, H, W = flow.shape | ||
# reshape corr_x to [B*H*W, 1, 1, W] |
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.
# reshape corr_x to [B*H*W, 1, 1, W] | |
# reshape corr_x from [B, H, W, W] to [B*H*W, 1, 1, W] |
Motivation
add correlation and correlation lookup of flow1d.
Modification
correlation1d compute the correlation of feature1 and cross attention on x or y direction
correlation lookup serach on 2r+1 width or height space,