Skip to content
Permalink
Browse files

fix(shot-detector): fix case of only one shot in video

  • Loading branch information...
numb3r3 committed Sep 5, 2019
1 parent 93a43f5 commit d70e877e352eb16d77526aaf01eab622d321bd92
Showing with 3 additions and 0 deletions.
  1. +3 −0 gnes/preprocessor/helper.py
@@ -358,6 +358,9 @@ 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'])
if len(p) == 0:
return [0, num_frames]

shots.append(0)
shots.append(p[0] + 2)
for i in range(1, len(p)):

0 comments on commit d70e877

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