diff options
| -rw-r--r-- | live-mogrify.py | 15 | ||||
| -rw-r--r-- | options/dataset_options.py | 2 |
2 files changed, 12 insertions, 5 deletions
diff --git a/live-mogrify.py b/live-mogrify.py index 546d411..0a7587b 100644 --- a/live-mogrify.py +++ b/live-mogrify.py @@ -134,10 +134,17 @@ class Listener(): def _set_fn(self, key, value): if hasattr(self.data_opt, key): try: - new_opt, misc = self.data_opt_parser.parse_known_args([ '--' + key.replace('_', '-'), str(value) ]) - new_value = getattr(new_opt, key) - setattr(self.data_opt, key, new_value) - print('set {} {}: {}'.format(type(new_value), key, new_value)) + if str(value) == 'true': + setattr(self.data_opt, key, True) + print('set {} {}: {}'.format(type(new_value), key, True) + elif str(value) == 'false': + setattr(self.data_opt, key, False) + print('set {} {}: {}'.format(type(new_value), key, False)) + else: + new_opt, misc = self.data_opt_parser.parse_known_args([ '--' + key.replace('_', '-'), str(value) ]) + new_value = getattr(new_opt, key) + setattr(self.data_opt, key, new_value) + print('set {} {}: {}'.format(type(new_value), key, new_value)) except Exception as e: print('error {} - cant set value {}: {}'.format(e, key, value)) def _get_fn(self): diff --git a/options/dataset_options.py b/options/dataset_options.py index ade222f..7229812 100644 --- a/options/dataset_options.py +++ b/options/dataset_options.py @@ -119,7 +119,7 @@ class DatasetOptions(BaseOptions): self.parser.add_argument( '--transition-max', - default=1e-3, + default=1.0, type=float, help='maximum amount of stabilization to apply' ) |
