Skip to content

Commit b98f83c

Browse files
NicolasHugfacebook-github-bot
authored andcommitted
[fbsync] Add support of MViTv2 video variants (#6373)
Summary: * Extending to support MViTv2 * Fix docs, mypy and linter * Refactor the relative positional code. * Code refactoring. * Rename vars. * Update docs. * Replace assert with exception. * Updat docs. * Minor refactoring. * Remove the square input limitation. * Moving methods around. * Modify the shortcut in the attention layer. * Add ported weights. * Introduce a `residual_cls` config on the attention layer. * Make the patch_embed kernel/padding/stride configurable. * Apply changes from code-review. * Remove stale todo. Reviewed By: datumbox Differential Revision: D38824226 fbshipit-source-id: 2950997bb37e431d76a0480b5b938b15b1d5eeaf
1 parent dfbc999 commit b98f83c

File tree

4 files changed

+369
-34
lines changed

4 files changed

+369
-34
lines changed

docs/source/models/video_mvit.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The MViT model is based on the
1212
Model builders
1313
--------------
1414

15-
The following model builders can be used to instantiate a MViT model, with or
15+
The following model builders can be used to instantiate a MViT v1 or v2 model, with or
1616
without pre-trained weights. All the model builders internally rely on the
1717
``torchvision.models.video.MViT`` base class. Please refer to the `source
1818
code
@@ -24,3 +24,4 @@ more details about this class.
2424
:template: function.rst
2525

2626
mvit_v1_b
27+
mvit_v2_s
939 Bytes
Binary file not shown.

test/test_models.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,9 @@ def _check_input_backprop(model, inputs):
309309
"mvit_v1_b": {
310310
"input_shape": (1, 3, 16, 224, 224),
311311
},
312+
"mvit_v2_s": {
313+
"input_shape": (1, 3, 16, 224, 224),
314+
},
312315
}
313316
# speeding up slow models:
314317
slow_models = [

0 commit comments

Comments
 (0)