Commit bfeba12
authored
Add Video Swin Transformer (#2369)
* init video swin
* add: 3d window size computation
* add: mlp layer
* add: patch embedding layer
* add: patch merging layer
* add: window attention layer
* add: basic layer for video swin
* update: basic layer for video swin
* add: swin blocks for video swin
* create and add: video swin backbone
* rename: video swin layers to model specific
* update module import
* update module import
* set class method to private usage
* set init params for backbone
* rm redundant imports
* add video swin layer test cases
* add: videoswin backbone aliases
* add: video swin backbone presets
* add: video swin backbone presets test
* update: video swin backbone presets test
* add: video classifier task
* add: video swin classifier presets
* run formatters
* rename module name/id"
* add hard-coded normalization for include rescaling=true
* add docstring for videoswin backbone
* update metadata: backbone presets no weights
* update: backbone presets no weights test
* update video swin aliases for no weights
* add: video swin backbone presets with weights
* update: video swin aliases with weights presets
* update video swin layer test cases
* added patch merging test
* imported video swins presets to backbone presets list"
* fix: typos"
* run formatters"
* fix: linting issue
* fix: linting issue
* fix: video swin layer test cases"
* add: video swin backbone test
* rm redundant code
* disable preset test temporary
* set include rescale to true
* add video swin components to __init__
* update docstrings: video siwn layers scripts
* update copywrite status: video siwn layers test scripts
* update copywrite status: video siwn backbone scripts
* bug fixes: video swin backbone layers
* update get config of video swin backbone
* enable: video swin backbone test cases
* update: video swin backbone test cases
* update: video swin backbone preset test cases
* run formatters
* fix typos: video swin backbone test cases
* add: non implemented property for test reason
* fix: typos
* add: video classifier test
* update: video classifier test
* update: video classifier test input shape
* bug fix: mlp layer build method
* updated: swin back layer build method
* bug fix: use tf.TensorShape in compute_output_shape method
* update: video_classifier_test model.predict to model.call
* update test cases and format the code
* update docstrings and preset config
* fix jax DynamicJaxprTrace issue for
* update config of backbone aliases
* add can run in mixed precision test
* add can run on gray video
* minor fix
* specify axis in keras.ops.take to match with tf.gather
* specify include rescaling to backbone class
* remove shift size form get config of video basic layer
* add support arbitrary input shape
* minor updates to swin layers
* test method update for swin layers
* update test method to swin backbone
* remove unsed code
* bug fix in call method of patch embed layer
* fix typo in patch merging layer
* minor fix
* fix keras.ops.cond issue with jax
* no test for jit compile in torch
* reduce tensor size for forward test
* minor fix
* remove kcv export decorator
* update keras.Layer import
* remove unused layer import
* replace keras.layers instead of layers
* update keras.Layer to keras.layers.Layer for keras2
* add window_size param to aliases
* move vide swin layer to model specific directory
* minor fix1 parent c123d51 commit bfeba12
File tree
13 files changed
+2171
-0
lines changed- keras_cv/models
- backbones
- video_swin
- classification
13 files changed
+2171
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
182 | 194 | | |
183 | 195 | | |
184 | 196 | | |
185 | 197 | | |
186 | 198 | | |
| 199 | + | |
187 | 200 | | |
188 | 201 | | |
189 | 202 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| 46 | + | |
45 | 47 | | |
46 | 48 | | |
47 | 49 | | |
| |||
55 | 57 | | |
56 | 58 | | |
57 | 59 | | |
| 60 | + | |
58 | 61 | | |
59 | 62 | | |
60 | 63 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
Lines changed: 158 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
0 commit comments