From 092379e18810956381a3347bd8730016526d7af9 Mon Sep 17 00:00:00 2001 From: raccoonliukai <903896015@qq.com> Date: Thu, 19 Sep 2019 12:40:20 +0800 Subject: [PATCH] fix(preprocessor): fix type of index in shotdetect --- gnes/preprocessor/video/shotdetect.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnes/preprocessor/video/shotdetect.py b/gnes/preprocessor/video/shotdetect.py index a67d5940..8b8bda16 100644 --- a/gnes/preprocessor/video/shotdetect.py +++ b/gnes/preprocessor/video/shotdetect.py @@ -99,7 +99,7 @@ def apply(self, doc: 'gnes_pb2.Document') -> None: shot_len = len(frames) c.weight = shot_len / num_frames if self.sframes > 0 and shot_len > self.sframes: - start_id = (shot_len - self.sframes) / 2 + start_id = int((shot_len - self.sframes) / 2) end_id = start_id + self.sframes frames = frames[start_id:end_id] chunk_data = np.array(frames)