diff options
Diffstat (limited to 'cli/app/search/live.py')
| -rw-r--r-- | cli/app/search/live.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/cli/app/search/live.py b/cli/app/search/live.py index 35fef19..1fd3ddf 100644 --- a/cli/app/search/live.py +++ b/cli/app/search/live.py @@ -101,10 +101,13 @@ class SinParam: orbit_time = InterpolatorParam(name=name + '_time', value=0.0) if lerp: noise = LerpParam(name + '_noise', shape=shape, datatype=datatype, ease=easing.LinearInOut) - output = tf.math.sin(orbit_time.variable + noise.output) * orbit_radius.variable + noise_out = noise.output else: noise = InterpolatorParam(name + '_noise_a', shape=shape, datatype=datatype) - output = tf.math.sin(orbit_time.variable + noise.variable) * orbit_radius.variable + noise_out = noise.variable + sin = tf.math.sin(orbit_time.variable + noise_out) * orbit_radius.variable + cos = tf.math.cos(orbit_time.variable + noise_out) * orbit_radius.variable + output = sin + cos interpolator.sin_params[name] = self self.name = name self.orbit_speed = orbit_speed @@ -115,7 +118,7 @@ class SinParam: self.t = 0 def update(self): - self.orbit_time.assign((np.pi * 0.25) / self.orbit_speed.value, immediate=True) + self.orbit_time.assign((np.pi * 2) / self.orbit_speed.value, immediate=True) self.t += 1 # randomize the orbit when possible - # - check if we've done one full orbital period @@ -484,7 +487,6 @@ class Listener: gen_time_total = 0 to_pil_time_total = 0 save_time_total = 0 - resize_time_total = 0 send_time_total = 0 for i in range(99999): if i == 0: @@ -517,9 +519,7 @@ class Listener: out_img.save(pipe.stdin, format='png', compression_level=3) save_time_total += time.time() - save_time - resize_time = time.time() img_to_send = out_img.resize((256, 256), Image.BICUBIC) - resize_time_total += time.time() - resize_time meta = { 'i': i, @@ -531,5 +531,5 @@ class Listener: self.rpc_client.send_pil_image("frame_{:05d}.png".format(i+1), meta, img_to_send, 'jpg') send_time_total += time.time() - send_time if (i % 100) == 0 or i == 1: - print("step: {}, gen: {:.2f}, pil: {:.2f}, save: {:.2f}, resize: {:.2f}, send: {:.2f}".format(i, gen_time_total / i, to_pil_time_total / i, save_time_total / i, resize_time_total / i, send_time_total / i)) + print("step: {}, gen: {:.2f}, pil: {:.2f}, save: {:.2f}, send: {:.2f}".format(i, gen_time_total / i, to_pil_time_total / i, save_time_total / i, send_time_total / i)) |
