Skip to content

Commit 78ae446

Browse files
author
arch
committed
add evenly intermediate points hyperparameter
1 parent 35364e8 commit 78ae446

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

funscript_editor/algorithms/signal.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ class SignalParameter:
2121
high_second_derivative_points_threshold: float = float(HYPERPARAMETER['signal']['high_second_derivative_points_threshold'])
2222
direction_change_filter_len: int = int(HYPERPARAMETER['signal']['direction_change_filter_len'])
2323
additional_points_repetitions: int = int(HYPERPARAMETER['signal']['additional_points_repetitions'])
24+
min_evenly_intermediate_interframes: int = int(HYPERPARAMETER['signal']['min_evenly_intermediate_interframes'])
2425

2526

2627
class Signal:
@@ -344,7 +345,10 @@ def get_evenly_intermediate_points(self, signal: list, base_points: list) -> lis
344345
additional_points = []
345346
for i in range(len(base_points) - 1):
346347
diff = base_points[i+1] - base_points[i]
347-
if diff < 3:
348+
if diff < 2:
349+
continue
350+
351+
if diff < 2*self.params.min_evenly_intermediate_interframes:
348352
continue
349353

350354
additional_points.append(base_points[i] + round(diff/2))

funscript_editor/config/hyperparameter.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ signal:
3737
# threshold value to merge additional points
3838
additional_points_merge_distance_threshold: 8.0
3939

40+
# min interframes without an additional datapoint for the evenly intermediate algorithm
41+
min_evenly_intermediate_interframes: 2
42+
4043
# number of runs for the additional points algorithm (max number of points that will be insert between 2 base points)
4144
additional_points_repetitions: 2
4245

0 commit comments

Comments
 (0)