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

[Feature] Add BasicVSR++ #451

Merged
merged 9 commits into from
Aug 5, 2021
Merged

Conversation

ckkelvinchan
Copy link
Member

@codecov
Copy link

codecov bot commented Jul 24, 2021

Codecov Report

Merging #451 (63938db) into master (6f6ebd6) will decrease coverage by 0.37%.
The diff coverage is 60.31%.

❗ Current head 63938db differs from pull request most recent head 91e697a. Consider uploading reports for the commit 91e697a to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master     #451      +/-   ##
==========================================
- Coverage   80.92%   80.54%   -0.38%     
==========================================
  Files         189      190       +1     
  Lines       10149    10338     +189     
  Branches     1495     1533      +38     
==========================================
+ Hits         8213     8327     +114     
- Misses       1721     1781      +60     
- Partials      215      230      +15     
Flag Coverage Δ
unittests 80.52% <60.31%> (-0.38%) ⬇️

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

Impacted Files Coverage Δ
mmedit/models/backbones/__init__.py 100.00% <ø> (ø)
...medit/models/backbones/sr_backbones/basicvsr_pp.py 60.10% <60.10%> (ø)
mmedit/models/backbones/sr_backbones/__init__.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6f6ebd6...91e697a. Read the comment docs.

o1, o2, mask = torch.chunk(out, 3, dim=1)

# offset
offset = 10 * torch.tanh(torch.cat((o1, o2), dim=1))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why this number is 10?

Copy link
Collaborator

Choose a reason for hiding this comment

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

You may give some comments on this number. Otherwise, you can make it user-defined but offer a default value of 10.


return flows_forward, flows_backward

def propagate(self, feats, flows, module):
Copy link
Collaborator

Choose a reason for hiding this comment

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

module_name may be better.

"""Compute the output image given the features.

Args:
lqs (tensor): Input LR images with shape (n, t, c, h, w).
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is lqs short for? You may specify the meaning of lqs.

Copy link
Collaborator

@nbei nbei left a comment

Choose a reason for hiding this comment

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

LGTM

@nbei nbei requested a review from innerlee August 2, 2021 18:33
@nbei
Copy link
Collaborator

nbei commented Aug 2, 2021

@innerlee may have a look.

| [basicvsr_plusplus_c64n7_8x1_300k_vimeo90k_bi](/configs/restorers/basicvsr/basicvsr_plusplus_c64n7_8x1_300k_vimeo90k_bi.py) | 31.0126/0.8804 | **37.7864/0.9500** | **27.7882/0.8401** | 33.1211/0.9270 | 33.8972/0.9195 | 23.6086/0.7033 | [model](https://download.openmmlab.com/mmediting/restorers/basicvsr_plusplus/basicvsr_plusplus_c64n7_8x1_300k_vimeo90k_bi_20210305-4ef437e2.pth) \| [log](https://download.openmmlab.com/mmediting/restorers/basicvsr_plusplus/basicvsr_plusplus_c64n7_8x1_300k_vimeo90k_bi_20210305_141254.log.json) |
| [basicvsr_plusplus_c64n7_8x1_300k_vimeo90k_bd](/configs/restorers/basicvsr/basicvsr_plusplus_c64n7_8x1_300k_vimeo90k_bd.py) | 29.2041/0.8528 | 34.7248/0.9351 | 26.4377/0.8074 | **40.7216/0.9722** | **38.2054/0.9550** | **29.0400/0.8753** | [model](https://download.openmmlab.com/mmediting/restorers/basicvsr_plusplus/basicvsr_plusplus_c64n7_8x1_300k_vimeo90k_bd_20210305-ab315ab1.pth) \| [log](https://download.openmmlab.com/mmediting/restorers/basicvsr_plusplus/basicvsr_plusplus_c64n7_8x1_300k_vimeo90k_bd_20210305_140921.log.json) |

## NTIRE 2021 checkpoints
Copy link
Contributor

@innerlee innerlee Aug 5, 2021

Choose a reason for hiding this comment

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

wrap L29-39 to a <details> section

def test_basicvsr_plusplus():
"""Test BasicVSR++."""

# gpu (DCN can only be tested in GPUs)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can DCN be turned off, and be tested on cpu?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes we can, but we need to create another argument to specify whether to skip the alignment.

Copy link
Member Author

Choose a reason for hiding this comment

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

Since this is one of the core parts of BasicVSR++, I am not sure whether adding this option is meaningful or not.

Copy link
Contributor

Choose a reason for hiding this comment

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

I just want to test it haha. It does not have to do with what basicvsr thinks

Copy link
Contributor

Choose a reason for hiding this comment

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

Or can you implement a cpu version of DCN?

Copy link
Member Author

Choose a reason for hiding this comment

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

Or can you implement a cpu version of DCN?

Not sure if I can do it in a short time haha. One workaround for now is to add the argument to skip alignment, and set it to False.

Copy link
Contributor

Choose a reason for hiding this comment

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

Or you can check the coverage report to see if more parts could be tested. 80% is a healthy line

@innerlee
Copy link
Contributor

innerlee commented Aug 5, 2021

Dropping blow 80% is not good

image

@innerlee innerlee merged commit 41c061f into open-mmlab:master Aug 5, 2021
@innerlee
Copy link
Contributor

innerlee commented Aug 5, 2021

@ckkelvinchan Please add this method to the repo's README

Yshuo-Li pushed a commit to Yshuo-Li/mmediting that referenced this pull request Jul 15, 2022
* Add BasicVSR++

* Update

* Add max_residue_magnitude as an argument

* Add configuration files and README

* Modify README

* Modify README

* Raise error about DCN if CUDA is not available

* Skip alignment in CPU mode
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.

None yet

3 participants