| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. | 2 # Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. |
| 3 # | 3 # |
| 4 # Use of this source code is governed by a BSD-style license | 4 # Use of this source code is governed by a BSD-style license |
| 5 # that can be found in the LICENSE file in the root of the source | 5 # that can be found in the LICENSE file in the root of the source |
| 6 # tree. An additional intellectual property rights grant can be found | 6 # tree. An additional intellectual property rights grant can be found |
| 7 # in the file PATENTS. All contributing project authors may | 7 # in the file PATENTS. All contributing project authors may |
| 8 # be found in the AUTHORS file in the root of the source tree. | 8 # be found in the AUTHORS file in the root of the source tree. |
| 9 | 9 |
| 10 """Perform APM module quality assessment on one or more input files using one or | 10 """Perform APM module quality assessment on one or more input files using one or |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 help='custom list of evaluation scores to use', | 56 help='custom list of evaluation scores to use', |
| 57 choices=_EVAL_SCORE_WORKER_NAMES, | 57 choices=_EVAL_SCORE_WORKER_NAMES, |
| 58 default=_EVAL_SCORE_WORKER_NAMES) | 58 default=_EVAL_SCORE_WORKER_NAMES) |
| 59 | 59 |
| 60 parser.add_argument('-o', '--output_dir', required=False, | 60 parser.add_argument('-o', '--output_dir', required=False, |
| 61 help=('base path to the output directory in which the ' | 61 help=('base path to the output directory in which the ' |
| 62 'output wav files and the evaluation outcomes ' | 62 'output wav files and the evaluation outcomes ' |
| 63 'are saved'), | 63 'are saved'), |
| 64 default='output') | 64 default='output') |
| 65 | 65 |
| 66 parser.add_argument('--polqa_path', required=True, |
| 67 help='path to the POLQA tool') |
| 68 |
| 69 parser.add_argument('--air_db_path', required=True, |
| 70 help='path to the Aechen IR database') |
| 71 |
| 66 return parser | 72 return parser |
| 67 | 73 |
| 68 | 74 |
| 69 def main(): | 75 def main(): |
| 70 # TODO(alessiob): level = logging.INFO once debugged. | 76 # TODO(alessiob): level = logging.INFO once debugged. |
| 71 logging.basicConfig(level=logging.DEBUG) | 77 logging.basicConfig(level=logging.DEBUG) |
| 72 | 78 |
| 73 parser = _instance_arguments_parser() | 79 parser = _instance_arguments_parser() |
| 74 args = parser.parse_args() | 80 args = parser.parse_args() |
| 75 | 81 |
| 76 simulator = simulation.ApmModuleSimulator() | 82 simulator = simulation.ApmModuleSimulator( |
| 83 aechen_ir_database_path=args.air_db_path, |
| 84 polqa_tool_path=args.polqa_path) |
| 77 simulator.run( | 85 simulator.run( |
| 78 config_filepaths=args.config_files, | 86 config_filepaths=args.config_files, |
| 79 input_filepaths=args.input_files, | 87 input_filepaths=args.input_files, |
| 80 noise_generator_names=args.noise_generators, | 88 noise_generator_names=args.noise_generators, |
| 81 eval_score_names=args.eval_scores, | 89 eval_score_names=args.eval_scores, |
| 82 output_dir=args.output_dir) | 90 output_dir=args.output_dir) |
| 83 | 91 |
| 84 sys.exit(0) | 92 sys.exit(0) |
| 85 | 93 |
| 86 | 94 |
| 87 if __name__ == '__main__': | 95 if __name__ == '__main__': |
| 88 main() | 96 main() |
| OLD | NEW |