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

Commit

Permalink
Merge pull request #273 from gnes-ai/fix_shot_detect
Browse files Browse the repository at this point in the history
fix(preprocessor): fix bug when num_frames < 4 in shotdetect
  • Loading branch information
mergify[bot] authored Sep 20, 2019
2 parents af879ba + 64acb4c commit fc32930
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 fc32930

Please sign in to comment.