diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2020-01-12 20:25:17 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2020-01-12 20:25:17 +0100 |
| commit | 6b92c49d2d44fa96415c03eff4bc0b9f101572c2 (patch) | |
| tree | cd0027db61cd8a02141912fe9f21e206cd95f693 /cli/app | |
| parent | dda80e68dce16622cf8ddc0fe197615a4be6f7b4 (diff) | |
dont use dt to lerp
Diffstat (limited to 'cli/app')
| -rw-r--r-- | cli/app/search/live.py | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/cli/app/search/live.py b/cli/app/search/live.py index ca54a76..8e63fc5 100644 --- a/cli/app/search/live.py +++ b/cli/app/search/live.py @@ -100,8 +100,8 @@ class SinParam: self.orbit_time = orbit_time self.output = output - def update(self, dt): - self.orbit_time.value += self.orbit_speed.value / FPS * dt + def update(self): + self.orbit_time.value += self.orbit_speed.value / FPS class LerpParam: def __init__(self, name, shape, a_in=None, b_in=None, datatype="noise"): @@ -135,9 +135,9 @@ class LerpParam: else: target_param.assign(target_value) - def update(self, dt): + def update(self): if self.direction != 0: - self.n.value = clamp(self.n.value + self.direction * self.speed.value / FPS * dt) + self.n.value = clamp(self.n.value + self.direction * self.speed.value / FPS) print("set_opt: {}_n {}".format(self.name, self.n.value)) if self.n.value == 0 or self.n.value == 1: self.direction = 0 @@ -345,11 +345,11 @@ class Interpolator: label_stored.b.assign(new_label) encoding_stored_mix.switch() - def on_step(self, i, dt, sess): + def on_step(self, i, sess): for param in self.sin_params.values(): - param.update(dt) + param.update() for param in self.lerp_params.values(): - param.update(dt) + param.update() gen_images = sess.run(self.gen_img, feed_dict=self.get_feed_dict()) return gen_images @@ -399,14 +399,13 @@ class Listener: tag = "biggan_" + timestamp() path_out = os.path.join(app_cfg.DIR_RESULTS, tag) os.makedirs(path_out, exist_ok=True) - dt = 1 / FPS for i in range(99999): if i == 0: print("Loading network...") elif i == 1: print("Processing!") gen_time = time.time() - gen_images = interpolator.on_step(i, dt, self.sess) + gen_images = interpolator.on_step(i, self.sess) if gen_images is None: print("Exiting...") break |
