OLD | NEW |
1 # Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. | 1 # Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. |
2 # | 2 # |
3 # Use of this source code is governed by a BSD-style license | 3 # Use of this source code is governed by a BSD-style license |
4 # that can be found in the LICENSE file in the root of the source | 4 # that can be found in the LICENSE file in the root of the source |
5 # tree. An additional intellectual property rights grant can be found | 5 # tree. An additional intellectual property rights grant can be found |
6 # in the file PATENTS. All contributing project authors may | 6 # in the file PATENTS. All contributing project authors may |
7 # be found in the AUTHORS file in the root of the source tree. | 7 # be found in the AUTHORS file in the root of the source tree. |
8 | 8 |
9 import logging | 9 import logging |
10 import os | 10 import os |
11 | 11 |
12 from . import audioproc_wrapper | 12 from . import audioproc_wrapper |
13 from . import data_access | 13 from . import data_access |
14 from . import eval_scores | 14 from . import eval_scores |
| 15 from . import evaluation |
15 from . import noise_generation | 16 from . import noise_generation |
16 | 17 |
17 class ApmModuleSimulator(object): | 18 class ApmModuleSimulator(object): |
18 | 19 |
19 _NOISE_GENERATOR_CLASSES = noise_generation.NoiseGenerator.REGISTERED_CLASSES | 20 _NOISE_GENERATOR_CLASSES = noise_generation.NoiseGenerator.REGISTERED_CLASSES |
20 _EVAL_SCORE_WORKER_CLASSES = eval_scores.EvaluationScore.REGISTERED_CLASSES | 21 _EVAL_SCORE_WORKER_CLASSES = eval_scores.EvaluationScore.REGISTERED_CLASSES |
21 | 22 |
22 def __init__(self): | 23 def __init__(self): |
23 self._audioproc_wrapper = audioproc_wrapper.AudioProcWrapper() | 24 self._audioproc_wrapper = audioproc_wrapper.AudioProcWrapper() |
24 | 25 self._evaluator = evaluation.ApmModuleEvaluator() |
25 # TODO(alessio): instance when implementation is ready. | |
26 self._evaluator = None | |
27 | 26 |
28 self._base_output_path = None | 27 self._base_output_path = None |
29 self._noise_generators = None | 28 self._noise_generators = None |
30 self._evaluation_score_workers = None | 29 self._evaluation_score_workers = None |
31 self._config_filepaths = None | 30 self._config_filepaths = None |
32 self._input_filepaths = None | 31 self._input_filepaths = None |
33 | 32 |
34 def run(self, config_filepaths, input_filepaths, noise_generator_names, | 33 def run(self, config_filepaths, input_filepaths, noise_generator_names, |
35 eval_score_names, output_dir): | 34 eval_score_names, output_dir): |
36 """ | 35 """ |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 """ | 107 """ |
109 Given a list of file paths, makes a collection with one pair for each item | 108 Given a list of file paths, makes a collection with one pair for each item |
110 in the list where the key is the file name without extension and the value | 109 in the list where the key is the file name without extension and the value |
111 is the path. | 110 is the path. |
112 """ | 111 """ |
113 filepaths_collection = {} | 112 filepaths_collection = {} |
114 for filepath in filepaths: | 113 for filepath in filepaths: |
115 name = os.path.splitext(os.path.split(filepath)[1])[0] | 114 name = os.path.splitext(os.path.split(filepath)[1])[0] |
116 filepaths_collection[name] = os.path.abspath(filepath) | 115 filepaths_collection[name] = os.path.abspath(filepath) |
117 return filepaths_collection | 116 return filepaths_collection |
OLD | NEW |