-
Notifications
You must be signed in to change notification settings - Fork 31.6k
#26566 swin2 sr allow in out channels #26568
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
#26566 swin2 sr allow in out channels #26568
Conversation
younesbelkada
left a comment
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 @marvingabler
Thanks for your contribution! as you are removing the num_channels attribute I think that this is a breaking change, what about keeping num_channels and make it behave as num_channels_in and use num_channels_out as an optional argument that is initialized as the same value as num_channels in case it is set to None. That way I believe changes will be backward compatible. What do you think?
|
Good point, yes lets do that! Let me update the PR soon :) |
younesbelkada
left a comment
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.
Looking great to me! thanks!
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. |
ArthurZucker
left a comment
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.
Thanks! Can you add a small test as well? Making sure that a dummy model with a this can still perform as expected! 😉
src/transformers/models/swin2sr/convert_swin2sr_original_to_pytorch.py
Outdated
Show resolved
Hide resolved
|
Just realized that there are a couple of more changes required, as the |
…nnels!=#output_channels
ArthurZucker
left a comment
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.
Looks good to me thanks for adding this.
LysandreJik
left a comment
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.
Great, thanks!
What does this PR do?
This PR adds the feature of accepting arbitary number of input and output channels when using the Swin2SR model. This allows to perform super resolution from greyscale (1 channel) to color (rgb), or from low resolution multi band satellite to high resolution rgb satellite.
All examples and pretrained models are running as expected based on my tests. No new dependencies have been added.
Just use it like
Fixes #26566.
Before submitting
Pull Request section?
documentation guidelines, and
here are tips on formatting docstrings.
Tagging the reviewers