Skip to content

[Features] : add flow1d correlation and correlation lookup#213

Open
Fc-idris wants to merge 5 commits into
open-mmlab:masterfrom
Fc-idris:add-flow1d-correlation
Open

[Features] : add flow1d correlation and correlation lookup#213
Fc-idris wants to merge 5 commits into
open-mmlab:masterfrom
Fc-idris:add-flow1d-correlation

Conversation

@Fc-idris
Copy link
Copy Markdown
Contributor

@Fc-idris Fc-idris commented Aug 8, 2022

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,

@codecov
Copy link
Copy Markdown

codecov Bot commented Aug 8, 2022

Codecov Report

Base: 69.10% // Head: 70.27% // Increases project coverage by +1.17% 🎉

Coverage data is based on head (0c6f7e1) compared to base (47d7ece).
Patch coverage: 92.64% of modified lines in pull request are covered.

❗ Current head 0c6f7e1 differs from pull request most recent head e089745. Consider uploading reports for the commit e089745 to get more accurate results

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     
Flag Coverage Δ
unittests 70.27% <92.64%> (+1.17%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
mmflow/models/flow_estimators/flow1d.py 82.69% <82.69%> (ø)
mmflow/models/decoders/flow1d_decoder.py 93.45% <93.45%> (ø)
mmflow/models/decoders/__init__.py 100.00% <100.00%> (ø)
mmflow/models/flow_estimators/__init__.py 100.00% <100.00%> (ø)
mmflow/models/utils/correlation1d.py 100.00% <100.00%> (ø)
mmflow/ops/corr_lookup.py 98.73% <100.00%> (+0.95%) ⬆️
mmflow/datasets/pipelines/transforms.py 79.33% <0.00%> (ø)

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.
📢 Do you have feedback about the report comment? Let us know in this issue.

Comment thread mmflow/models/utils/correlation1d.py Outdated
self,
feat1: Tensor,
feat2_x: Tensor,
feat2_y: Tensor,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
feat2_y: Tensor,
feat2_y: Tensor

Comment thread mmflow/models/utils/correlation1d.py Outdated
Comment thread mmflow/models/utils/correlation1d.py Outdated
Comment on lines +87 to +89
corr = corr.permute(0, 2, 1, 3).contiguous().view(b, h, w, 1, h, 1)
corr = corr / scale_factor
corr = corr.flatten(0, 2)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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

Comment thread mmflow/models/utils/correlation1d.py Outdated
Comment thread mmflow/ops/corr_lookup.py Outdated
concatenate together.
"""
B, _, H, W = flow.shape
# reshape corr_x to [B*H*W, 1, 1, W]
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# 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]

Comment thread mmflow/ops/corr_lookup.py Outdated
@Fc-idris Fc-idris changed the title feat: add flow1d correlation and correlation lookup [Features] : add flow1d correlation and correlation lookup Aug 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants