File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed
funscript_editor/algorithms Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -225,6 +225,7 @@ def tracking(self) -> str:
225225
226226 signal = Signal (self .video_info .fps )
227227 points = signal .get_local_min_max_points (result )
228+ # points = signal.get_direction_changes(result, filter_len=4)
228229 categorized_points = signal .categorize_points (result , points )
229230
230231 for k in self .funscripts :
Original file line number Diff line number Diff line change 99from numpy .linalg import norm
1010from funscript_editor .utils .config import HYPERPARAMETER
1111
12+ import matplotlib .pyplot as plt
1213
1314@dataclass
1415class SignalParameter :
@@ -63,10 +64,7 @@ def moving_average(x: list, w: int) -> list:
6364 if w == 1 :
6465 return x
6566
66- avg = np .convolve (x , np .ones (int (w * 2 )), 'valid' ) / int (w * 2 )
67- return [avg [0 ] for _ in range (int (w ))] \
68- + list (avg ) \
69- + [avg [- 1 ] for _ in range (len (avg )+ w ,len (x ))]
67+ return np .convolve (x , np .ones (int (w * 2 )) / (w * 2 ), 'same' )
7068
7169
7270 @staticmethod
You can’t perform that action at this time.
0 commit comments