Skip to content
This repository has been archived by the owner on Feb 22, 2020. It is now read-only.

Commit

Permalink
fix(preprocessor): fix bug when num_frames < 4 in shotdetect
Browse files Browse the repository at this point in the history
  • Loading branch information
raccoonliukai committed Sep 20, 2019
1 parent af879ba commit 64acb4c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gnes/preprocessor/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down

0 comments on commit 64acb4c

Please sign in to comment.