Skip to content
Permalink
Browse files

fix(preprocessor): fix bug when num_frames < 4 in shotdetect

  • Loading branch information...
raccoonliukai committed Sep 20, 2019
1 parent af879ba commit 64acb4cd2b7a4b426169e1e46a871ff5cb526eff
Showing with 1 addition and 1 deletion.
  1. +1 −1 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]

0 comments on commit 64acb4c

Please sign in to comment.
You can’t perform that action at this time.