Beispiel #1
0
 def _determine_settings(self):
     input_config = self.helper.task_settings
     logger.info('Input config', extra={'config': input_config})
     config = deepcopy(self.default_settings)
     sly.update_recursively(config, input_config)
     logger.info('Full config', extra={'config': config})
     SettingsValidator.validate_train_cfg(config)
     self.config = config
Beispiel #2
0
    def _determine_settings(self):
        input_config = self.helper.task_settings
        logger.info('Input config', extra={'config': input_config})

        config = deepcopy(self.default_settings)
        if 'mode' in input_config and 'source' in input_config['mode']:
            mode_name = input_config['mode']['source']
            default_mode_settings = self.default_settings_for_modes.get(mode_name, None)
            if default_mode_settings is not None:
                sly.update_recursively(config['mode'], deepcopy(default_mode_settings))
            # config now contains default values for selected mode

        sly.update_recursively(config, input_config)
        logger.info('Full config', extra={'config': config})
        SettingsValidator.validate_inference_cfg(config)
        self.config = config