Example #1
0
def test_SeparateSpeech_invalid_inference_config(
    enh_inference_config, invalid_enh_inference_config
):
    with pytest.raises(AssertionError):
        SeparateSpeech(
            train_config=None, model_file=None, inference_config=enh_inference_config
        )

    with pytest.raises(AssertionError):
        SeparateSpeech(train_config=None, inference_config=invalid_enh_inference_config)
Example #2
0
def test_SeparateSpeech(config_file, batch_size, input_size, segment_size,
                        hop_size):
    separate_speech = SeparateSpeech(enh_train_config=config_file,
                                     segment_size=segment_size,
                                     hop_size=hop_size)
    wav = torch.rand(batch_size, input_size)
    separate_speech(wav, fs=8000)
Example #3
0
def test_SeparateSpeech(config_file, batch_size, input_size, segment_size, hop_size):
    if not is_torch_1_2_plus:
        pytest.skip("Pytorch Version Under 1.2 is not supported for Enh task")

    separate_speech = SeparateSpeech(
        enh_train_config=config_file, segment_size=segment_size, hop_size=hop_size
    )
    wav = torch.rand(batch_size, input_size)
    separate_speech(wav, fs=8000)
Example #4
0
def test_enh_s2t_SeparateSpeech_with_inference_config(
    enh_s2t_config_file, enh_s2t_inference_config
):
    separate_speech = SeparateSpeech(
        train_config=enh_s2t_config_file,
        inference_config=enh_s2t_inference_config,
        enh_s2t_task=True,
    )
    wav = torch.rand(2, 16000)
    separate_speech(wav, fs=8000)
Example #5
0
def test_enh_s2t_SeparateSpeech(
    enh_s2t_config_file,
    batch_size,
    input_size,
    segment_size,
    hop_size,
    normalize_segment_scale,
):
    separate_speech = SeparateSpeech(
        train_config=enh_s2t_config_file,
        segment_size=segment_size,
        hop_size=hop_size,
        normalize_segment_scale=normalize_segment_scale,
        enh_s2t_task=True,
    )
    wav = torch.rand(batch_size, input_size)
    separate_speech(wav, fs=8000)
Example #6
0
def test_SeparateSpeech_with_inference_config(config_file, enh_inference_config):
    separate_speech = SeparateSpeech(
        train_config=config_file, inference_config=enh_inference_config
    )
    wav = torch.rand(2, 16000)
    separate_speech(wav, fs=8000)