From 64acb4cd2b7a4b426169e1e46a871ff5cb526eff Mon Sep 17 00:00:00 2001 From: raccoonliukai <903896015@qq.com> Date: Fri, 20 Sep 2019 19:52:38 +0800 Subject: [PATCH] fix(preprocessor): fix bug when num_frames < 4 in shotdetect --- gnes/preprocessor/helper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnes/preprocessor/helper.py b/gnes/preprocessor/helper.py index d723a1b9..2badba2f 100644 --- a/gnes/preprocessor/helper.py +++ b/gnes/preprocessor/helper.py @@ -357,7 +357,7 @@ def motion_algo(distances: List[float], **kwargs) -> List[int]: shots = [] num_frames = len(distances) + 1 - p = peakutils.indexes(np.array(distances).astype('float32'), thres=arg_dict['threshold'], min_dist=arg_dict['min_dist']) + p = peakutils.indexes(np.array(distances).astype('float32'), thres=arg_dict['threshold'], min_dist=arg_dict['min_dist']) if len(distances) else [] if len(p) == 0: return [0, num_frames]