Used by non-intermediate models. Pass the output from encoder directly to decoder.
| 265 | |
| 266 | |
| 267 | class STPN_KD(Backbone): |
| 268 | """Used by non-intermediate models. Pass the output from encoder directly to decoder.""" |
| 269 | |
| 270 | def __init__(self, height_feat_size=13, compress_level=0, train_completion=False): |
| 271 | super().__init__(height_feat_size, compress_level, train_completion) |
| 272 | |
| 273 | def forward(self, x): |
| 274 | batch, seq, z, h, w = x.size() |
| 275 | encoded_layers = super().encode(x) |
| 276 | decoded_layers = super().decode( |
| 277 | *encoded_layers, batch, kd_flag=True, requires_adaptive_max_pool3d=True |
| 278 | ) |
| 279 | return (*decoded_layers, encoded_layers[3], encoded_layers[4]) |
| 280 | |
| 281 | |
| 282 |