diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2020-01-19 01:49:04 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2020-01-19 01:49:04 +0100 |
| commit | be1740ca2591ed5e29ddfe5cd7293d71c607ac01 (patch) | |
| tree | 3008f6501fd634088a669ed3290056871e9d4aac /cli | |
| parent | b98d56450d24cbc715885005860d2d4aa4fde72c (diff) | |
parameter smoothing
Diffstat (limited to 'cli')
| -rw-r--r-- | cli/app/search/live.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/cli/app/search/live.py b/cli/app/search/live.py index 7c11b24..2dc3a09 100644 --- a/cli/app/search/live.py +++ b/cli/app/search/live.py @@ -24,7 +24,7 @@ from app.search.params import timestamp from app.utils.cortex_utils import results_folder, upload_file_to_cortex from app.utils.tf_utils import read_checkpoint from subprocess import Popen, PIPE -from easing_functions import QuadEaseInOut +import easing_functions as easing # frames per second FPS = 25 @@ -100,7 +100,7 @@ class SinParam: orbit_speed = InterpolatorParam(name=name + '_speed', value=FPS, smooth=True) orbit_time = InterpolatorParam(name=name + '_time', value=0.0) if lerp: - noise = LerpParam(name + '_noise', shape=shape, datatype=datatype) + noise = LerpParam(name + '_noise', shape=shape, datatype=datatype, ease=easing.LinearInOut) output = tf.math.sin(orbit_time.variable + noise.output) * orbit_radius.variable else: noise = InterpolatorParam(name + '_noise_a', shape=shape, datatype=datatype) @@ -125,7 +125,7 @@ class SinParam: self.t = 0 class LerpParam: - def __init__(self, name, shape, a_in=None, b_in=None, datatype="noise"): + def __init__(self, name, shape, a_in=None, b_in=None, datatype="noise", ease=easing.QuadEaseInOut): if a_in is not None and b_in is not None: a = InterpolatorVariable(variable=a_in) b = InterpolatorVariable(variable=b_in) @@ -142,7 +142,7 @@ class LerpParam: self.b = b self.n = n self.t = t - self.ease = QuadEaseInOut(start=0, end=1, duration=1) + self.ease = ease(start=0, end=1, duration=1) self.speed = speed self.output = output self.direction = 0 |
