-
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
[Enhance] Support dynamic input shape for ViT-based algorithms #706
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #706 +/- ##
==========================================
- Coverage 85.22% 84.94% -0.28%
==========================================
Files 121 121
Lines 7432 7548 +116
Branches 1278 1303 +25
==========================================
+ Hits 6334 6412 +78
- Misses 911 944 +33
- Partials 187 192 +5
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
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.
please add DeprecationWarning in PatchEmbed and PatchMerge.
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.
LGTM.
img_size=224, | ||
patch_size=16, | ||
in_channels=3, |
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.
This introduces BC-breaking in mmselfsup 0.6.0.
…-mmlab#706) * Move `resize_pos_embed` to `mmcls.models.utils` * Refactor Vision Transformer * Refactor DeiT * Refactor MLP-Mixer * Refactor Swin-Transformer * Remove `indexing` arg * Support dynamic inputs for t2t_vit * Add copyright * Fix bugs in swin transformer * Add `pad_small_maps` option * Update swin transformer * Handle `attn_mask` in checkpoints of swin * Imporve by comments
Excuse me @mzr1996 . Could you please explain how you did to make ViT-based algorithms to support dynamic input shape? |
Motivation
Currently, our ViT-based algorithms need to specify the image shape. But in some downstream tasks, they need input images with various shapes.
Modification
Refactor these ViT-based algorithms to support dynamic input shape as far as possible.
BC-breaking (Optional)
The
input_resolution
andauto_pad
argument are deprecated in theShiftWindowMSA
. And theauto_pad
argument is removed fromSwinTransformer
.Use cases (Optional)
Checklist
Before PR:
After PR: