-
Notifications
You must be signed in to change notification settings - Fork 1k
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] Support various scales in RRDBNet #699
Conversation
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.
@anse3832 Thank you very much! Would you mind changing also realesrnet_c64b23g32_12x4_lr2e-4_1000k_df2k_ost.py and adding the unittest for the added support here?
Thanks again!
Codecov Report
@@ Coverage Diff @@
## master #699 +/- ##
==========================================
+ Coverage 80.59% 81.81% +1.22%
==========================================
Files 200 211 +11
Lines 11419 11896 +477
Branches 1831 1912 +81
==========================================
+ Hits 9203 9733 +530
+ Misses 1932 1868 -64
- Partials 284 295 +11
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
187d11b
to
78f4c5b
Compare
# x2 model, initialization and forward (cpu) | ||
net = RRDBNet( | ||
in_channels=3, | ||
out_channels=3, | ||
scale=2, | ||
mid_channels=8, | ||
num_blocks=2, | ||
growth_channels=4) | ||
net_init_weights(pretrained=None) | ||
input_shape = (1, 3, 12, 12) | ||
img = _demo_inputs(input_shape) | ||
output = net(img) | ||
assert output.shape == (1, 3, 24, 24) | ||
|
||
# x2 model forward (gpu) | ||
if torch.cuda.is_avaliable(): | ||
net = net.cuda() | ||
output = net(img.cuda()) | ||
assert output.shape == (1, 3, 24, 24) | ||
|
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 unittest does not pass. Here you can simply copy the original one and set scale
to 2.
b3193b4
to
ffb0cfa
Compare
Hi @anse3832, it seems that linting failed. You can first install pre-commit by After that every time you commit something, it will check the format for you. Thank you very much for your contributions and we are almost there! |
In addition, unittest also failed. You may try to run the test locally to test whether it has any errors~ |
I'm a member of the team with anse3832. |
Hi @nijkah, thank you very much! I will check it. |
@ckkelvinchan
Considering above concerns, I suggest newly writing the code for "RRDBNet" in Real-ESRGAN as "RealRRDBNet"
Is it okay to proceed these works? If you have any suggestions, please let me know. |
Thank you for your suggestions! What I meant in the previous reply is that we want to cover the following line of code. That means we are not going to support x3. We just need to make sure in the unittest that an error will be raised. I checked the official code and it seems that x3 is not supported neither. |
@ckkelvinchan |
When you expect an error, you should use By the way, you do not need to separate RealRRDBNet from RRDBNet. That means, we support only 1x, 2x, and 4x only, and for 1x and 2x, we use an additional pixel-unshuffle. Thanks again! |
@ckkelvinchan If it is allowed to use pixelunshuffle in ESRGAN (although the official code does not support), I did not need to separate the code for ESRGAN and Real-ESRGAN. In this case, the code supports for x1, x2 or x4 scale. (Neither of official ESRGAN or Real-ESRGAN supports x3 scale)
If I should follow the official code, I think it's better to separate the code.
|
Yes it is allowed to use pixel-unshuffle in ESRGAN. Since this modification does not affect the original ESRGAN. We can extend it to support x1 and x2. |
6982f45
to
e9e5e25
Compare
Lint & Fix import error
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.
Hi @anse3832 it seems that CI failed. Could you help have a look? Thanks again for your help. |
378a5bb
to
50d9a20
Compare
@ckkelvinchan Fixed. I think it works this time. 🙏 |
Checked lint failure. |
Feature/real esrgan
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.
Your efforts are very much appreciated. Look forward to working with you next time! |
Hi all, it seems that this PR accidentally changes file permissions of some config files from 644 to 755, can anybody help to fix that? |
@wangruohui |
It is fixed in #718 by @wangruohui. Thanks anyways! |
Co-authored-by: nijkah <nijkah@gmail.com> Co-authored-by: hakjinlee <hakjinlee@si-analytics.ai>
Co-authored-by: nijkah <nijkah@gmail.com> Co-authored-by: hakjinlee <hakjinlee@si-analytics.ai>
Hi @anse3832!First of all, we want to express our gratitude for your significant PR in the MMEditing project. Your contribution is highly appreciated, and we are grateful for your efforts in helping improve this open-source project during your personal time. We believe that many developers will benefit from your PR. We would also like to invite you to join our Special Interest Group (SIG) private channel on Discord, where you can share your experiences, ideas, and build connections with like-minded peers. To join the SIG channel, simply message moderator— OpenMMLab on Discord or briefly share your open-source contributions in the #introductions channel and we will assist you. Look forward to seeing you there! Join us :https://discord.gg/UjgXkPWNqA If you have WeChat account,welcome to join our community on WeChat. You can add our assistant :openmmlabwx. Please add "mmsig + Github ID" as a remark when adding friends:) |
Motivation
Modification