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

Commit

Permalink
fix(shot-detector): fix case of only one shot in video
Browse files Browse the repository at this point in the history
  • Loading branch information
felix committed Sep 5, 2019
1 parent 93a43f5 commit d70e877
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions gnes/preprocessor/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)):
Expand Down

0 comments on commit d70e877

Please sign in to comment.