From fe4f4ed346a079418e4c6a6adb5ff0662bdb3617 Mon Sep 17 00:00:00 2001 From: xujinling Date: Wed, 22 Jun 2022 19:12:54 +0800 Subject: [PATCH] skip Signed-off-by: xujinling --- video_swin_transformer.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/video_swin_transformer.py b/video_swin_transformer.py index d0af874..acb0d66 100644 --- a/video_swin_transformer.py +++ b/video_swin_transformer.py @@ -65,11 +65,14 @@ class VideoSwinTransformer(NNOperator): mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225], ) + self.model.eval() def decoder_video(self, data: List[VideoFrame]): video = numpy.stack([img.astype(numpy.float32) / 255. for img in data], axis=0) assert len(video.shape) == 4 video = video.transpose(3, 0, 1, 2) # twhc -> ctwh + if self.skip_preprocess: + self.transform_cfgs.update(num_frames=None) video = transform_video( video=video, **self.transform_cfgs