evaluate
Evaluate the enhanced signals using HAAQI and Whisper
- recipes.cad2.task1.baseline.evaluate.compute_intelligibility(enhanced_signal: ndarray, segment_metadata: dict, scorer: Module, listener: Listener, sample_rate: int, save_intermediate: bool = False, path_intermediate: str | Path | None = None, equiv_0db_spl: float = 100) tuple[float, float, dict] [source]
Compute the Intelligibility score for the enhanced signal using the Whisper model.
To the enhanced signal, we apply the MSGB hearing loss model before transcribing with Whisper.
- Parameters:
enhanced_signal – The enhanced signal
segment_metadata – The metadata of the segment
scorer – The Whisper model
listener – The listener
sample_rate – The sample rate of the signal
save_intermediate – Save the intermediate signal
path_intermediate – The path to save the intermediate signal
equiv_0db_spl – The equivalent 0 dB SPL
- Returns:
The intelligibility score for the left and right channels
- recipes.cad2.task1.baseline.evaluate.compute_quality(reference_signal: ndarray, enhanced_signal: ndarray, listener: Listener, config: DictConfig) tuple[float, float] [source]
Compute the HAAQI score for the left and right channels
- recipes.cad2.task1.baseline.evaluate.load_reference_signal(path: str | Path, start_sample: int | None, end_sample: int | None, level_luft: float = -40.0) ndarray [source]
Load the reference signal
- recipes.cad2.task1.baseline.evaluate.make_scene_listener_list(scenes_listeners: dict, small_test: bool = False) list [source]
Make the list of scene-listener pairing to process
- Parameters:
scenes_listeners (dict) – Dictionary of scenes and listeners.
small_test (bool) – Whether to use a small test set.
- Returns:
List of scene-listener pairings.
- Return type:
list
- recipes.cad2.task1.baseline.evaluate.normalise_luft(signal: ndarray, sample_rate: float, target_luft: float = -40.0) ndarray [source]
Normalise the signal to a target loudness level. :param signal: input signal to normalise :param sample_rate: sample rate of the signal :param target_luft: target loudness level in LUFS.
- Returns:
normalised signal
- Return type:
np.ndarray
- recipes.cad2.task1.baseline.evaluate.run_compute_scores(config: DictConfig) None [source]
Compute the scores for the enhanced signals