linter + test

pull/510/head
WeberJulian 2021-03-05 18:44:41 +01:00 committed by Eren Gölge
parent fba0c828cd
commit e769a95916
2 changed files with 13 additions and 14 deletions

View File

@ -16,16 +16,14 @@ if __name__ == '__main__':
parser = argparse.ArgumentParser(
description='''Resample a folder recusively with librosa
Can be used in place or create a copy of the folder as an output.\n\n'''
'''
Example run:
python TTS/bin/resample.py
--input_dir /root/LJSpeech-1.1/
--output_sr 22050
--output_dir /root/resampled_LJSpeech-1.1/
--n_jobs 24
''',
Can be used in place or create a copy of the folder as an output.\n\n
Example run:
python TTS/bin/resample.py
--input_dir /root/LJSpeech-1.1/
--output_sr 22050
--output_dir /root/resampled_LJSpeech-1.1/
--n_jobs 24
''',
formatter_class=RawTextHelpFormatter)
parser.add_argument('--input_dir',
@ -33,7 +31,7 @@ Example run:
default=None,
required=True,
help='Path of the folder containing the audio files to resample')
parser.add_argument('--output_sr',
type=int,
default=22050,
@ -45,7 +43,7 @@ Example run:
default=None,
required=False,
help='Path of the destination folder. If not defined, the operation is done in place')
parser.add_argument('--n_jobs',
type=int,
default=None,
@ -55,11 +53,11 @@ Example run:
if args.output_dir:
print('Recursively copying the input folder...')
shutil.copytree(args.input_dir, args.output_dir)
copy_tree(args.input_dir, args.output_dir)
args.input_dir = args.output_dir
print('Resampling the audio files...')
audio_files = glob.glob(os.path.join(args.input_dir,'**/*.wav'), recursive=True)
audio_files = glob.glob(os.path.join(args.input_dir, '**/*.wav'), recursive=True)
print(f'Found {len(audio_files)} files...')
with Pool(processes=args.n_jobs) as p:
with tqdm(total=len(audio_files)) as pbar:

View File

@ -6,6 +6,7 @@ nosetests tests -x &&\
# runtime tests
./tests/test_demo_server.sh && \
./tests/test_resample.sh && \
./tests/test_tacotron_train.sh && \
./tests/test_glow-tts_train.sh && \
./tests/test_vocoder_gan_train.sh && \