def main(): stimestamp = get_timestamp() parser = ArgumentParser( description='Tool for making series of experiments', allow_abbrev=False) parser.add_argument('-c', '--config', required=True, help='Path to a config file') parser.add_argument( '-o', '--output-dir', default='.', help='Path to a folder to store the results, default is ".".') log_levels = ['CRITICAL', 'ERROR', 'WARNING', 'INFO', 'DEBUG'] parser.add_argument('--log-level', type=str, default='INFO', choices=log_levels, help='Log level to print: {}'.format(log_levels)) parser.add_argument( '--dry-run', action='store_true', help='If everything excepth actual run of experiment should be done') args = parser.parse_args() dry_run = args.dry_run init_logger(level=args.log_level, stream=sys.stdout) config_path = Path(args.config) root_dir = args.output_dir root_dir = Path(root_dir) series_dir = root_dir / ('series_experiments_' + stimestamp) series_dir = series_dir.absolute() config = read_config_from_file(config_path) experiment_template_path = Path(config['experiment_template']).absolute() if not experiment_template_path.exists(): raise RuntimeError('Cannot find experiment template "{}"'.format( experiment_template_path)) experiment_params, num_experiments = _parse_experiment_params( config['params']) _run_experiments(experiment_template_path=experiment_template_path, experiment_params=experiment_params, num_experiments=num_experiments, series_dir=series_dir, stimestamp=stimestamp, root_dir=root_dir, dry_run=dry_run)
# Copyright (C) 2020-2021 Intel Corporation # SPDX-License-Identifier: Apache-2.0 from pathlib import Path import sys sys.path.insert(0, Path(__file__).resolve().parent.parent.parent.as_posix()) # pylint: disable=C0413 from openvino.tools.pot.utils.config_reader import read_config_from_file, write_config_to_file src = Path(sys.argv[1]) dst = Path(sys.argv[2]) data = read_config_from_file(src) write_config_to_file(data, dst)