Browse Source
modify
Signed-off-by: gexy5 <xinyu.ge@zilliz.com>
main
gexy5
2 years ago
1 changed files with
7 additions and
1 deletions
-
tsm.py
|
|
@ -96,7 +96,13 @@ class Tsm(NNOperator): |
|
|
|
inputs = data.to(self.device)[None, ...] |
|
|
|
|
|
|
|
feats = self.model.forward_features(inputs) |
|
|
|
features = feats.to('cpu').squeeze(0).detach().numpy() |
|
|
|
if self.model.reshape: |
|
|
|
if self.model.is_shift and self.model.temporal_pool: |
|
|
|
base_out = feats.view((-1, self.model.num_segments // 2) + feats.size()[1:]) |
|
|
|
else: |
|
|
|
base_out = feats.view((-1, self.model.num_segments) + feats.size()[1:]) |
|
|
|
output = self.model.consensus(base_out) |
|
|
|
features = output.to('cpu').squeeze(0).detach().numpy() |
|
|
|
|
|
|
|
outs = self.model.head(feats) |
|
|
|
post_act = torch.nn.Softmax(dim=1) |
|
|
|