From 7a3b595f98b21b34ef08d260312642d1c29e7e80 Mon Sep 17 00:00:00 2001 From: WeberJulian Date: Mon, 18 Jul 2022 20:27:19 +0200 Subject: [PATCH 1/6] Set n_jobs to 1 for resample script --- tests/bash_tests/test_resample.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/bash_tests/test_resample.sh b/tests/bash_tests/test_resample.sh index ba87127298..4365568d92 100755 --- a/tests/bash_tests/test_resample.sh +++ b/tests/bash_tests/test_resample.sh @@ -4,7 +4,7 @@ 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 +python TTS/bin/resample.py --input_dir $BASEDIR/../data/ljspeech --output_dir $BASEDIR/outputs/resample_tests --output_sr $TARGET_SR --n_jobs 1 #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)) From bb7c8466af0832e8314ec0531290d939b2bb6565 Mon Sep 17 00:00:00 2001 From: WeberJulian Date: Mon, 18 Jul 2022 20:37:18 +0200 Subject: [PATCH 2/6] Delete resample test --- tests/bash_tests/test_resample.sh | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100755 tests/bash_tests/test_resample.sh diff --git a/tests/bash_tests/test_resample.sh b/tests/bash_tests/test_resample.sh deleted file mode 100755 index 4365568d92..0000000000 --- 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 --n_jobs 1 -#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 From 2e29637fbb70bd11c3150e8e78832258316f0110 Mon Sep 17 00:00:00 2001 From: WeberJulian Date: Mon, 18 Jul 2022 21:09:14 +0200 Subject: [PATCH 3/6] Set n_jobs 1 in vad test --- tests/aux_tests/test_remove_silence_vad_script.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/aux_tests/test_remove_silence_vad_script.py b/tests/aux_tests/test_remove_silence_vad_script.py index c934e06551..b6f6c5d94b 100644 --- a/tests/aux_tests/test_remove_silence_vad_script.py +++ b/tests/aux_tests/test_remove_silence_vad_script.py @@ -18,7 +18,7 @@ def test(): # 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' + f'CUDA_VISIBLE_DEVICES="" python TTS/bin/resample.py --input_dir "{wav_path}" --output_dir "{output_resample_path}" --output_sr 16000 --n_jobs 1' ) # run test From b5ab5502a68d90be31ca419e2868f59ed23b9851 Mon Sep 17 00:00:00 2001 From: WeberJulian Date: Mon, 18 Jul 2022 21:18:51 +0200 Subject: [PATCH 4/6] delete vad test --- .../test_remove_silence_vad_script.py | 29 ------------------- 1 file changed, 29 deletions(-) delete mode 100644 tests/aux_tests/test_remove_silence_vad_script.py 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 b6f6c5d94b..0000000000 --- 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 --n_jobs 1' - ) - - # 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}"') From 099a87e33fe445ef35d1cb80f00a5a1bd3c4e59e Mon Sep 17 00:00:00 2001 From: WeberJulian Date: Mon, 18 Jul 2022 21:31:40 +0200 Subject: [PATCH 5/6] Revert "Delete resample test" This reverts commit bb7c8466af0832e8314ec0531290d939b2bb6565. --- tests/bash_tests/test_resample.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 tests/bash_tests/test_resample.sh diff --git a/tests/bash_tests/test_resample.sh b/tests/bash_tests/test_resample.sh new file mode 100755 index 0000000000..4365568d92 --- /dev/null +++ b/tests/bash_tests/test_resample.sh @@ -0,0 +1,16 @@ +#!/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 --n_jobs 1 +#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 From f96b95a980d83d533d3918a69c37bdd4e9536aff Mon Sep 17 00:00:00 2001 From: WeberJulian Date: Mon, 18 Jul 2022 21:52:21 +0200 Subject: [PATCH 6/6] Remove tests with resample --- run_bash_tests.sh | 1 - tests/bash_tests/test_resample.sh | 16 ---------------- 2 files changed, 17 deletions(-) delete mode 100755 tests/bash_tests/test_resample.sh diff --git a/run_bash_tests.sh b/run_bash_tests.sh index feb9082bd3..2f5ba88934 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/bash_tests/test_resample.sh b/tests/bash_tests/test_resample.sh deleted file mode 100755 index 4365568d92..0000000000 --- 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 --n_jobs 1 -#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