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

Commit

Permalink
fix(video preprocessor): use dict update
Browse files Browse the repository at this point in the history
  • Loading branch information
raccoonliukai committed Aug 22, 2019
1 parent 47721b1 commit 5b5feb0
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions gnes/preprocessor/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,7 @@ def canny_edge(image: 'np.ndarray', **kwargs) -> 'np.ndarray':
'gauss_kernel': (9, 9),
'l2_gradient': True
}
for k, v in kwargs.items():
if k in arg_dict.keys():
arg_dict[k] = v
arg_dict.update(kwargs)

image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
# apply automatic Canny edge detection using the computed median
Expand Down Expand Up @@ -402,10 +400,9 @@ def motion_algo(distances: List[float], **kwargs) -> List[int]:
'min_dist': 10,
'motion_step': 15
}
arg_dict.update(kwargs)

shots = []
for k, v in kwargs.items():
if k in arg_dict.keys():
arg_dict[k] = v
num_frames = len(distances) + 1
p = peakutils.indexes(np.array(distances).astype('float32'), thres=arg_dict['threshold'], min_dist=arg_dict['min_dist'])
shots.append(0)
Expand Down

0 comments on commit 5b5feb0

Please sign in to comment.