summaryrefslogtreecommitdiff
path: root/test-mogrify.py
diff options
context:
space:
mode:
Diffstat (limited to 'test-mogrify.py')
-rw-r--r--test-mogrify.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/test-mogrify.py b/test-mogrify.py
index c1e0c71..68f279d 100644
--- a/test-mogrify.py
+++ b/test-mogrify.py
@@ -131,7 +131,6 @@ if __name__ == '__main__':
print("https://asdf.us/neural/" + video_fn)
-
if data_opt.mov:
render_video()
sys.exit(1)
@@ -194,6 +193,11 @@ if __name__ == '__main__':
image_pil.save(tmp_path)
os.rename(tmp_path, render_path)
+ def clamp(n,a,b):
+ return max(a, min(n, b))
+ def lerp(n,a,b):
+ return (b-a)*n+a
+
if dataset.name() == 'RecursiveDatasetDataLoader':
if data_opt.recursive and last_im is not None:
tmp_im = im.copy()
@@ -201,7 +205,7 @@ if __name__ == '__main__':
if data_opt.sequence and A_dir is not None:
A_img = Image.open(sequence_path).convert('RGB')
A_im = np.asarray(A_img)
- t = math.sin(i / 3000 * math.pi * 2 ) / 2 + 1
+ t = lerp(math.sin(i / data_opt.transition_period * math.pi * 2 ) / 2 + 1, data_opt.transition_min, 1.0)
frac_a = data_opt.recursive_frac * (1 - t)
frac_b = data_opt.sequence_frac * (1 - t)
frac_c = 1.0 - frac_a - frac_b