diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-05-21 13:11:34 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-05-21 13:11:34 +0200 |
| commit | 041061cad41141748bb6803f63cce06cfa764df1 (patch) | |
| tree | 302d32b978dca9e105e145ad3c77aec389d93f8e | |
| parent | 8fde6a0d43946f4ee268d868b224180e0c027815 (diff) | |
vars..
| -rw-r--r-- | live-mogrify.py | 14 | ||||
| -rw-r--r-- | options/dataset_options.py | 6 | ||||
| -rw-r--r-- | test-live.sh | 1 |
3 files changed, 16 insertions, 5 deletions
diff --git a/live-mogrify.py b/live-mogrify.py index 90fe30e..63a7962 100644 --- a/live-mogrify.py +++ b/live-mogrify.py @@ -134,10 +134,10 @@ class Listener(): def _set_fn(self, key, value): if hasattr(self.data_opt, key): try: - if str(value) == 'true': + if str(value) == 'True': setattr(self.data_opt, key, True) print('set {} {}: {}'.format(type(new_value), key, True)) - elif str(value) == 'false': + elif str(value) == 'False': setattr(self.data_opt, key, False) print('set {} {}: {}'.format(type(new_value), key, False)) else: @@ -198,9 +198,13 @@ def process_live_input(opt, data_opt, rpc_client): 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 = lerp(math.sin(i / data_opt.transition_period * math.pi * 2.0 ) / 2.0 + 0.5, data_opt.transition_min, data_opt.transition_max) - frac_a = data_opt.recursive_frac * (1.0 - t) - frac_b = data_opt.sequence_frac * (1.0 - t) + if data_opt.transition: + t = lerp(math.sin(i / data_opt.transition_period * math.pi * 2.0 ) / 2.0 + 0.5, data_opt.transition_min, data_opt.transition_max) + frac_a = data_opt.recursive_frac * (1.0 - t) + frac_b = data_opt.sequence_frac * (1.0 - t) + else: + frac_a = data_opt.recursive_frac + frac_b = data_opt.sequence_frac frac_c = 1.0 - frac_a - frac_b array_a = np.multiply(last_im.astype('float64'), frac_a) array_b = np.multiply(A_im.astype('float64'), frac_b) diff --git a/options/dataset_options.py b/options/dataset_options.py index 7229812..5457c22 100644 --- a/options/dataset_options.py +++ b/options/dataset_options.py @@ -104,6 +104,12 @@ class DatasetOptions(BaseOptions): ### RECURSION self.parser.add_argument( + '--transition', + action='store_true', + help=' sine wave transition' + ) + + self.parser.add_argument( '--transition-period', default=3000, type=int, diff --git a/test-live.sh b/test-live.sh index ad8422e..27e2ae6 100644 --- a/test-live.sh +++ b/test-live.sh @@ -6,6 +6,7 @@ --recursive --recursive-frac 0.1 \ --sequence --sequence-frac 0.3 \ --process-frac 0.5 \ + --transition \ --transition-min 0.05 \ --how_many 100000 --transition-period 1000 \ --loadSize 256 --fineSize 256 \ |
