logo
Browse Source

modify

Signed-off-by: gexy5 <xinyu.ge@zilliz.com>
main
gexy5 2 years ago
parent
commit
afec9778d7
  1. BIN
      TSM_kinetics_RGB_resnet50_shift8_blockres_avg_segment8_e50.pth
  2. 4
      tsm.py

BIN
TSM_kinetics_RGB_resnet50_shift8_blockres_avg_segment8_e50.pth

Binary file not shown.

4
tsm.py

@ -87,7 +87,7 @@ class Tsm(NNOperator):
# Transform video data given configs # Transform video data given configs
if self.skip_preprocess: if self.skip_preprocess:
self.cfg.update(num_frames=None)
self.transform_cfgs.update(num_frames=None)
data = transform_video( data = transform_video(
video=video, video=video,
@ -98,7 +98,7 @@ class Tsm(NNOperator):
feats = self.model.forward_features(inputs) feats = self.model.forward_features(inputs)
features = feats.to('cpu').squeeze(0).detach().numpy() features = feats.to('cpu').squeeze(0).detach().numpy()
outs = self.model(feats)
outs = self.model.head(feats)
post_act = torch.nn.Softmax(dim=1) post_act = torch.nn.Softmax(dim=1)
preds = post_act(outs) preds = post_act(outs)
pred_scores, pred_classes = preds.topk(k=self.topk) pred_scores, pred_classes = preds.topk(k=self.topk)

Loading…
Cancel
Save