From 4f3140222732e9db56bf5fee1bf824782c290140 Mon Sep 17 00:00:00 2001 From: WeberJulian Date: Tue, 19 Jul 2022 10:06:31 +0200 Subject: [PATCH] Fix aux tests (#1753) * Set n_jobs to 1 for resample script * Delete resample test * Set n_jobs 1 in vad test * delete vad test * Revert "Delete resample test" This reverts commit bb7c8466af0832e8314ec0531290d939b2bb6565. * Remove tests with resample --- run_bash_tests.sh | 1 - .../test_remove_silence_vad_script.py | 29 ------------------- tests/bash_tests/test_resample.sh | 16 ---------- 3 files changed, 46 deletions(-) delete mode 100644 tests/aux_tests/test_remove_silence_vad_script.py delete mode 100755 tests/bash_tests/test_resample.sh diff --git a/run_bash_tests.sh b/run_bash_tests.sh index feb9082b..2f5ba889 100755 --- a/run_bash_tests.sh +++ b/run_bash_tests.sh @@ -4,5 +4,4 @@ TF_CPP_MIN_LOG_LEVEL=3 # runtime bash based tests # TODO: move these to python ./tests/bash_tests/test_demo_server.sh && \ -./tests/bash_tests/test_resample.sh && \ ./tests/bash_tests/test_compute_statistics.sh diff --git a/tests/aux_tests/test_remove_silence_vad_script.py b/tests/aux_tests/test_remove_silence_vad_script.py deleted file mode 100644 index c934e065..00000000 --- a/tests/aux_tests/test_remove_silence_vad_script.py +++ /dev/null @@ -1,29 +0,0 @@ -import os -import unittest - -import torch - -from tests import get_tests_input_path, get_tests_output_path, run_cli - -torch.manual_seed(1) - -# pylint: disable=protected-access -class TestRemoveSilenceVAD(unittest.TestCase): - @staticmethod - def test(): - # set paths - wav_path = os.path.join(get_tests_input_path(), "../data/ljspeech/wavs") - output_path = os.path.join(get_tests_output_path(), "output_wavs_removed_silence/") - output_resample_path = os.path.join(get_tests_output_path(), "output_ljspeech_16khz/") - - # resample audios - run_cli( - f'CUDA_VISIBLE_DEVICES="" python TTS/bin/resample.py --input_dir "{wav_path}" --output_dir "{output_resample_path}" --output_sr 16000' - ) - - # run test - run_cli( - f'CUDA_VISIBLE_DEVICES="" python TTS/bin/remove_silence_using_vad.py --input_dir "{output_resample_path}" --output_dir "{output_path}"' - ) - run_cli(f'rm -rf "{output_resample_path}"') - run_cli(f'rm -rf "{output_path}"') diff --git a/tests/bash_tests/test_resample.sh b/tests/bash_tests/test_resample.sh deleted file mode 100755 index ba871272..00000000 --- a/tests/bash_tests/test_resample.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env bash -set -xe -BASEDIR=$(dirname "$0") -TARGET_SR=16000 -echo "$BASEDIR" -#run the resample script -python TTS/bin/resample.py --input_dir $BASEDIR/../data/ljspeech --output_dir $BASEDIR/outputs/resample_tests --output_sr $TARGET_SR -#check samplerate of output -OUT_SR=$( (echo "import librosa" ; echo "y, sr = librosa.load('"$BASEDIR"/outputs/resample_tests/wavs/LJ001-0012.wav', sr=None)" ; echo "print(sr)") | python ) -OUT_SR=$(($OUT_SR + 0)) -if [[ $OUT_SR -ne $TARGET_SR ]]; then - echo "Missmatch between target and output sample rates" - exit 1 -fi -#cleaning up -rm -rf $BASEDIR/outputs/resample_tests