diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-05-19 10:49:53 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-05-19 10:49:53 +0200 |
| commit | 3ac5fa26a191dc27434c60a6fb48deae828b7c90 (patch) | |
| tree | 4e993bedb0a389c23ca259dc66a2fe8a0caefa47 /test-mogrify.py | |
| parent | b7f45a7277152d5611f8f050243dd8d7c351979d (diff) | |
options for minimum recursion value
Diffstat (limited to 'test-mogrify.py')
| -rw-r--r-- | test-mogrify.py | 8 |
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 |
