Chromium Code Reviews

Unified Diff: webrtc/modules/audio_processing/test/py_quality_assessment/quality_assessment/eval_scores.py

Issue 2715233003: APM Quality Generator, noise generator and evaluation score workers factory + echo noise generator (Closed)
Patch Set: Noise generation and evaluation score workers now instantiated through factory objects, class decor… Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Index: webrtc/modules/audio_processing/test/py_quality_assessment/quality_assessment/eval_scores.py
diff --git a/webrtc/modules/audio_processing/test/py_quality_assessment/quality_assessment/eval_scores.py b/webrtc/modules/audio_processing/test/py_quality_assessment/quality_assessment/eval_scores.py
index 6787850f2321509fd3fc23e4c4876b4e614b8af5..7acf20406ae8e620c3ac0128344960315817a016 100644
--- a/webrtc/modules/audio_processing/test/py_quality_assessment/quality_assessment/eval_scores.py
+++ b/webrtc/modules/audio_processing/test/py_quality_assessment/quality_assessment/eval_scores.py
@@ -9,8 +9,8 @@
import logging
import os
-from .data_access import ScoreFile
-from .signal_processing import SignalProcessingUtils
+from . import data_access
+from . import signal_processing
class EvaluationScore(object):
@@ -31,6 +31,7 @@ class EvaluationScore(object):
Decorator to automatically register the classes that extend EvaluationScore.
"""
cls.REGISTERED_CLASSES[class_to_register.NAME] = class_to_register
+ return class_to_register
AleBzk 2017/03/06 11:29:53 bug fix, a class decorator must return the class
@property
def output_filepath(self):
@@ -54,12 +55,12 @@ class EvaluationScore(object):
def _load_reference_signal(self):
assert self._reference_signal_filepath is not None
- self._reference_signal = SignalProcessingUtils.load_wav(
+ self._reference_signal = signal_processing.SignalProcessingUtils.load_wav(
self._reference_signal_filepath)
def _load_tested_signal(self):
assert self._tested_signal_filepath is not None
- self._tested_signal = SignalProcessingUtils.load_wav(
+ self._tested_signal = signal_processing.SignalProcessingUtils.load_wav(
self._tested_signal_filepath)
def run(self, output_path):
@@ -79,10 +80,10 @@ class EvaluationScore(object):
raise NotImplementedError()
def _load_score(self):
- return ScoreFile.load(self._output_filepath)
+ return data_access.ScoreFile.load(self._output_filepath)
def _save_score(self):
- return ScoreFile.save(self._output_filepath, self._score)
+ return data_access.ScoreFile.save(self._output_filepath, self._score)
@EvaluationScore.register_class
@@ -119,8 +120,9 @@ class PolqaScore(EvaluationScore):
NAME = 'polqa'
- def __init__(self):
+ def __init__(self, polqa_tool_path):
EvaluationScore.__init__(self)
+ self._polqa_tool_path = polqa_tool_path
AleBzk 2017/03/06 11:29:53 @kjellander: now the POLQA path is passed in the c
def _run(self, output_path):
# TODO(alessio): implement.

Powered by Google App Engine