repo
stringlengths
2
99
file
stringlengths
13
225
code
stringlengths
0
18.3M
file_length
int64
0
18.3M
avg_line_length
float64
0
1.36M
max_line_length
int64
0
4.26M
extension_type
stringclasses
1 value
speechbrain
speechbrain-main/recipes/UrbanSound8k/SoundClassification/train.py
#!/usr/bin/python3 """Recipe for training sound class embeddings (e.g, xvectors) using the UrbanSound8k. We employ an encoder followed by a sound classifier. To run this recipe, use the following command: > python train_class_embeddings.py {hyperparameter_file} Using your own hyperparameter file or one of the followi...
16,914
36.175824
115
py
speechbrain
speechbrain-main/recipes/CommonLanguage/common_language_prepare.py
""" Data preparation of CommonLangauge dataset for LID. Download: https://zenodo.org/record/5036977#.YNo1mHVKg5k Author ------ Pavlo Ruban 2021 """ import os import csv import logging import torchaudio from tqdm.contrib import tzip from speechbrain.utils.data_utils import get_all_files logger = logging.getLogger(__...
7,969
24.876623
94
py
speechbrain
speechbrain-main/recipes/CommonLanguage/lang_id/common_language_prepare.py
../common_language_prepare.py
29
29
29
py
speechbrain
speechbrain-main/recipes/CommonLanguage/lang_id/train.py
#!/usr/bin/env python3 import os import sys import torch import logging import torchaudio import speechbrain as sb from hyperpyyaml import load_hyperpyyaml from common_language_prepare import prepare_common_language """Recipe for training a LID system with CommonLanguage. To run this recipe, do the following: > pytho...
10,881
33.328076
80
py
speechbrain
speechbrain-main/recipes/Aishell1Mix/prepare_data.py
""" The functions to create the .csv files for Aishell1Mix Author * Cem Subakan 2020 """ import os import csv import tarfile import zipfile import glob import tqdm.contrib.concurrent import soundfile as sf import functools from pysndfx import AudioEffectsChain from urllib.request import urlretrieve def prepare_ais...
12,102
30.600522
80
py
speechbrain
speechbrain-main/recipes/Aishell1Mix/separation/dynamic_mixing.py
import speechbrain as sb import numpy as np import torch import torchaudio import glob import os from speechbrain.dataio.batch import PaddedBatch from tqdm import tqdm import warnings import pyloudnorm import random """ The functions to implement Dynamic Mixing For SpeechSeparation Authors * Samuele Cornell 2021 ...
7,142
30.46696
93
py
speechbrain
speechbrain-main/recipes/Aishell1Mix/separation/prepare_data.py
../prepare_data.py
18
18
18
py
speechbrain
speechbrain-main/recipes/Aishell1Mix/separation/train.py
#!/usr/bin/env/python3 """Recipe for training a neural speech separation system on Aishell1Mix2/3 datasets. The system employs an encoder, a decoder, and a masking network. To run this recipe, do the following: > python train.py hparams/sepformer-aishell1mix2.yaml > python train.py hparams/sepformer-aishell1mix3.yaml ...
25,295
36.090909
108
py
speechbrain
speechbrain-main/recipes/Aishell1Mix/separation/scripts/create_aishell1mix_metadata.py
import argparse import os import random import warnings import numpy as np import pandas as pd import pyloudnorm as pyln import soundfile as sf from tqdm import tqdm # Global parameters # eps secures log and division EPS = 1e-10 # max amplitude in sources and mixtures MAX_AMP = 0.9 # In aishell1 all the sources are a...
17,357
35.012448
80
py
speechbrain
speechbrain-main/recipes/Aishell1Mix/separation/scripts/create_aishell1mix_from_metadata.py
import os import argparse import soundfile as sf import pandas as pd import numpy as np import functools from scipy.signal import resample_poly import tqdm.contrib.concurrent import glob import shutil # eps secures log and division EPS = 1e-10 # Rate of the sources in aishell1 RATE = 16000 parser = argparse.ArgumentP...
16,794
30.392523
95
py
speechbrain
speechbrain-main/recipes/Aishell1Mix/separation/scripts/create_aishell1_metadata.py
import os import argparse import soundfile as sf import pandas as pd import glob from tqdm import tqdm # Global parameter # We will filter out files shorter than that NUMBER_OF_SECONDS = 3 # In aishell1 all the sources are at 16K Hz RATE = 16000 # Command line arguments parser = argparse.ArgumentParser() parser.add_a...
5,508
32.797546
79
py
speechbrain
speechbrain-main/recipes/Aishell1Mix/separation/scripts/create_wham_metadata.py
import os import argparse import soundfile as sf import pandas as pd import glob from tqdm import tqdm # Global parameter # We will filter out files shorter than that NUMBER_OF_SECONDS = 3 # In WHAM! all the sources are at 16K Hz RATE = 16000 # Command line arguments parser = argparse.ArgumentParser() parser.add_argu...
3,893
33.460177
79
py
speechbrain
speechbrain-main/recipes/Aishell1Mix/meta/preprocess_dynamic_mixing.py
""" This script allows to resample a folder which contains audio files. The files are parsed recursively. An exact copy of the folder is created, with same structure but contained resampled audio files. Resampling is performed by using sox through torchaudio. Author ------ Samuele Cornell, 2020 """ import os import ar...
2,781
27.10101
80
py
speechbrain
speechbrain-main/recipes/LibriSpeech/librispeech_prepare.py
""" Data preparation. Download: http://www.openslr.org/12 Author ------ Mirco Ravanelli, Ju-Chieh Chou, Loren Lugosch 2020 """ import os import csv import random from collections import Counter import logging import torchaudio from tqdm.contrib import tzip from speechbrain.utils.data_utils import download_file, get_...
12,515
27.905312
87
py
speechbrain
speechbrain-main/recipes/LibriSpeech/LM/librispeech_prepare.py
../librispeech_prepare.py
25
25
25
py
speechbrain
speechbrain-main/recipes/LibriSpeech/LM/dataset.py
# coding=utf-8 # Copyright 2020 The TensorFlow Datasets Authors and the HuggingFace Datasets Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LI...
3,836
32.365217
138
py
speechbrain
speechbrain-main/recipes/LibriSpeech/LM/train.py
#!/usr/bin/env python3 """Recipe for training a Language Model with librispeech train-960 transcript and lm_corpus. To run this recipe, do the following: > pip install datasets > python train.py hparams/<hparam_file>.yaml --data_folder <local_path_to_librispeech_dataset> Authors * Jianyuan Zhong 2021 * Ju-Chieh Cho...
7,083
31.645161
94
py
speechbrain
speechbrain-main/recipes/LibriSpeech/G2P/evaluate.py
"""Recipe for evaluating a grapheme-to-phoneme system with librispeech lexicon. The script may be use in isolation or in combination with Orion to fit hyperparameters that do not require model retraining (e.g. Beam Search) """ from hyperpyyaml import load_hyperpyyaml from speechbrain.dataio.batch import PaddedBatch f...
14,699
34.083532
88
py
speechbrain
speechbrain-main/recipes/LibriSpeech/G2P/librispeech_prepare.py
../librispeech_prepare.py
25
25
25
py
speechbrain
speechbrain-main/recipes/LibriSpeech/G2P/train_lm.py
#!/usr/bin/env python3 """Recipe for training a language model with a phoneme model. > python train.py RNNLM.yaml To run this recipe, you need to first install the Huggingface dataset: > pip install datasets Authors * Ju-Chieh Chou 2020 * Jianyuan Zhong 2021 * Mirco Ravanelli 2021 * Artem Ploujnikov 2021 """ im...
7,998
30.996
80
py
speechbrain
speechbrain-main/recipes/LibriSpeech/G2P/train.py
#!/usr/bin/env/python3 """Recipe for training a grapheme-to-phoneme system with one of the available datasets. See README.md for more details Authors * Loren Lugosch 2020 * Mirco Ravanelli 2020 * Artem Ploujnikov 2021 """ from speechbrain.dataio.dataset import ( FilteredSortedDynamicItemDataset, DynamicIte...
43,545
32.887938
87
py
speechbrain
speechbrain-main/recipes/LibriSpeech/G2P/tokenizer_prepare.py
"""A script to prepare annotations for tokenizers """ import json import os import re import datasets from speechbrain.lobes.models.g2p.dataio import build_token_char_map MULTI_SPACE = re.compile(r"\s{2,}") def phn2txt(phn, phoneme_map): """Encodes phonemes using a character map for use with SentencePiece ...
2,512
26.315217
77
py
speechbrain
speechbrain-main/recipes/LibriSpeech/self-supervised-learning/wav2vec2/librispeech_prepare.py
../../librispeech_prepare.py
28
28
28
py
speechbrain
speechbrain-main/recipes/LibriSpeech/self-supervised-learning/wav2vec2/train_sb_wav2vec2.py
#!/usr/bin/env python3 """Recipe for pretraining wav2vec2 (https://arxiv.org/abs/2006.11477). See config file for model definition. See the readme of the recipe for advices on the pretraining that may appear a bit challenging depending on your available resources. To run this recipe call python train.py hparams/train_...
13,411
33.836364
111
py
speechbrain
speechbrain-main/recipes/LibriSpeech/Tokenizer/librispeech_prepare.py
../librispeech_prepare.py
25
25
25
py
speechbrain
speechbrain-main/recipes/LibriSpeech/Tokenizer/train.py
#!/usr/bin/env/python3 """Recipe for training a BPE tokenizer with librispeech. The tokenizer converts words into sub-word units that can be used to train a language (LM) or an acoustic model (AM). When doing a speech recognition experiment you have to make sure that the acoustic and language models are trained with th...
1,917
30.442623
72
py
speechbrain
speechbrain-main/recipes/LibriSpeech/ASR/transducer/librispeech_prepare.py
../../librispeech_prepare.py
28
28
28
py
speechbrain
speechbrain-main/recipes/LibriSpeech/ASR/transducer/train.py
#!/usr/bin/env/python3 """Recipe for training a Transducer ASR system with librispeech. The system employs an encoder, a decoder, and an joint network between them. Decoding is performed with beamsearch coupled with a neural language model. To run this recipe, do the following: > python train.py hparams/train.yaml Wi...
16,705
38.124122
89
py
speechbrain
speechbrain-main/recipes/LibriSpeech/ASR/seq2seq/librispeech_prepare.py
../../librispeech_prepare.py
28
28
28
py
speechbrain
speechbrain-main/recipes/LibriSpeech/ASR/seq2seq/train.py
#!/usr/bin/env/python3 """Recipe for training a sequence-to-sequence ASR system with librispeech. The system employs an encoder, a decoder, and an attention mechanism between them. Decoding is performed with beamsearch coupled with a neural language model. To run this recipe, do the following: > python train.py hparam...
15,618
35.92435
89
py
speechbrain
speechbrain-main/recipes/LibriSpeech/ASR/CTC/librispeech_prepare.py
../../librispeech_prepare.py
28
28
28
py
speechbrain
speechbrain-main/recipes/LibriSpeech/ASR/CTC/train_with_wav2vec.py
#!/usr/bin/env/python3 """Recipe for training a wav2vec-based ctc ASR system with librispeech. The system employs wav2vec as its encoder. Decoding is performed with ctc greedy decoder. To run this recipe, do the following: > python train_with_wav2vec.py hparams/train_{hf,sb}_wav2vec.yaml The neural network is trained o...
16,312
36.415138
89
py
speechbrain
speechbrain-main/recipes/LibriSpeech/ASR/CTC/train_with_whisper.py
#!/usr/bin/env/python3 """Recipe for training a whisper-based ctc ASR system with librispeech. The system employs whisper from OpenAI (https://cdn.openai.com/papers/whisper.pdf). This recipe take only the whisper encoder and add a DNN + CTC to fine-tune. If you want to use the full whisper system, please refer to the ...
13,226
35.238356
89
py
speechbrain
speechbrain-main/recipes/LibriSpeech/ASR/transformer/librispeech_prepare.py
../../librispeech_prepare.py
28
28
28
py
speechbrain
speechbrain-main/recipes/LibriSpeech/ASR/transformer/train.py
#!/usr/bin/env python3 """Recipe for training a Transformer ASR system with librispeech. The system employs an encoder, a decoder, and an attention mechanism between them. Decoding is performed with (CTC/Att joint) beamsearch coupled with a neural language model. To run this recipe, do the following: > python train.py...
19,105
36.171206
105
py
speechbrain
speechbrain-main/recipes/LibriSpeech/ASR/transformer/train_with_whisper.py
#!/usr/bin/env python3 """Recipe for training a whisper-based ASR system with librispeech. The system employs whisper from OpenAI (https://cdn.openai.com/papers/whisper.pdf). This recipe take the whisper encoder-decoder to fine-tune on the NLL. If you want to only use the whisper encoder system, please refer to the re...
11,771
34.457831
89
py
speechbrain
speechbrain-main/recipes/MEDIA/media_prepare.py
""" Data preparation. Download: https://catalogue.elra.info/en-us/repository/browse/ELRA-S0272/ https://catalogue.elra.info/en-us/repository/browse/ELRA-E0024/ https://drive.google.com/drive/u/1/folders/1z2zFZp3c0NYLFaUhhghhBakGcFdXVRyf See README.md for more info. Author ------ Gaelle Laperriere 2023 """ import xml....
36,330
28.465531
262
py
speechbrain
speechbrain-main/recipes/MEDIA/SLU/CTC/media_prepare.py
../../media_prepare.py
22
22
22
py
speechbrain
speechbrain-main/recipes/MEDIA/SLU/CTC/train_hf_wav2vec.py
#!/usr/bin/env python3 """ Recipe for training a CTC based SLU system with Media. The system employs a wav2vec2 model and a decoder. To run this recipe, do the following: > python train_with_wav2vec.py hparams/train_with_wav2vec.yaml With the default hyperparameters, the system employs a VanillaNN encoder. The neur...
13,866
34.284987
83
py
speechbrain
speechbrain-main/recipes/MEDIA/ASR/CTC/media_prepare.py
../../media_prepare.py
22
22
22
py
speechbrain
speechbrain-main/recipes/MEDIA/ASR/CTC/train_hf_wav2vec.py
#!/usr/bin/env python3 """ Recipe for training a CTC based ASR system with Media. The system employs a wav2vec2 model and a decoder. To run this recipe, do the following: > python train_with_wav2vec.py hparams/train_with_wav2vec.yaml With the default hyperparameters, the system employs a VanillaNN encoder. The neur...
12,920
33.827493
83
py
speechbrain
speechbrain-main/recipes/REAL-M/sisnr-estimation/dynamic_mixing_wham.py
../../WHAMandWHAMR/separation/dynamic_mixing.py
47
47
47
py
speechbrain
speechbrain-main/recipes/REAL-M/sisnr-estimation/create_whamr_rirs.py
../../WHAMandWHAMR/meta/create_whamr_rirs.py
44
44
44
py
speechbrain
speechbrain-main/recipes/REAL-M/sisnr-estimation/train_wham.py
../../WHAMandWHAMR/separation/train.py
38
38
38
py
speechbrain
speechbrain-main/recipes/REAL-M/sisnr-estimation/preprocess_dynamic_mixing_librimix.py
../../LibriMix/meta/preprocess_dynamic_mixing.py
48
48
48
py
speechbrain
speechbrain-main/recipes/REAL-M/sisnr-estimation/dynamic_mixing_librimix.py
../../LibriMix/separation/dynamic_mixing.py
43
43
43
py
speechbrain
speechbrain-main/recipes/REAL-M/sisnr-estimation/preprocess_dynamic_mixing_wham.py
../../WHAMandWHAMR/meta/preprocess_dynamic_mixing.py
52
52
52
py
speechbrain
speechbrain-main/recipes/REAL-M/sisnr-estimation/prepare_data_librimix.py
../../LibriMix/prepare_data.py
30
30
30
py
speechbrain
speechbrain-main/recipes/REAL-M/sisnr-estimation/prepare_data_wham.py
../../WHAMandWHAMR/prepare_data.py
34
34
34
py
speechbrain
speechbrain-main/recipes/REAL-M/sisnr-estimation/wham_room.py
../../WHAMandWHAMR/meta/wham_room.py
36
36
36
py
speechbrain
speechbrain-main/recipes/REAL-M/sisnr-estimation/train.py
#!/usr/bin/env/python3 """ Recipe for training a Blind SI-SNR estimator Authors: * Cem Subakan 2021 * Mirco Ravanelli 2021 * Samuele Cornell 2021 """ import os import sys import torch import speechbrain as sb import speechbrain.nnet.schedulers as schedulers from speechbrain.utils.distributed import run_on_main fro...
29,744
35.631773
152
py
speechbrain
speechbrain-main/recipes/WHAMandWHAMR/prepare_data.py
""" Author * Cem Subakan 2020 The .csv preperation functions for WSJ0-Mix. """ import os import csv def prepare_wham_whamr_csv( datapath, savepath, skip_prep=False, fs=8000, task="separation" ): """ Prepares the csv files for wham or whamr dataset Arguments: ---------- datapath (str) :...
5,989
28.653465
98
py
speechbrain
speechbrain-main/recipes/WHAMandWHAMR/separation/create_whamr_rirs.py
../meta/create_whamr_rirs.py
28
28
28
py
speechbrain
speechbrain-main/recipes/WHAMandWHAMR/separation/dynamic_mixing.py
import speechbrain as sb import numpy as np import torch import torchaudio import glob import os from pathlib import Path import random from speechbrain.processing.signal_processing import rescale from speechbrain.dataio.batch import PaddedBatch """ The functions to implement Dynamic Mixing For SpeechSeparation Autho...
7,212
30.915929
107
py
speechbrain
speechbrain-main/recipes/WHAMandWHAMR/separation/prepare_data.py
../prepare_data.py
18
18
18
py
speechbrain
speechbrain-main/recipes/WHAMandWHAMR/separation/wham_room.py
../meta/wham_room.py
20
20
20
py
speechbrain
speechbrain-main/recipes/WHAMandWHAMR/separation/train.py
#!/usr/bin/env/python3 """Recipe for training a neural speech separation system on WHAM! and WHAMR! datasets. The system employs an encoder, a decoder, and a masking network. To run this recipe, do the following: > python train.py hparams/sepformer-wham.yaml --data_folder /your_path/wham_original > python train.py hpa...
25,297
36.039531
108
py
speechbrain
speechbrain-main/recipes/WHAMandWHAMR/meta/create_whamr_rirs.py
""" Adapted from the original WHAMR script to obtain the Room Impulse ResponsesRoom Impulse Responses Authors * Cem Subakan 2021 """ import os import pandas as pd import argparse import torchaudio from wham_room import WhamRoom from scipy.signal import resample_poly import torch from speechbrain.pretrained.fetchi...
4,052
27.542254
97
py
speechbrain
speechbrain-main/recipes/WHAMandWHAMR/meta/rir_constants.py
NUM_BANDS = 4 SNR_THRESH = -6.0 PRE_NOISE_SECONDS = 2.0 SAMPLERATE = 16000 MAX_SAMPLE_AMP = 0.95 MIN_SNR_DB = -3.0 MAX_SNR_DB = 6.0 PRE_NOISE_SAMPLES = PRE_NOISE_SECONDS * SAMPLERATE
183
19.444444
50
py
speechbrain
speechbrain-main/recipes/WHAMandWHAMR/meta/preprocess_dynamic_mixing.py
""" This script allows to resample a folder which contains audio files. The files are parsed recursively. An exact copy of the folder is created, with same structure but contained resampled audio files. Resampling is performed by using sox through torchaudio. Author ------ Samuele Cornell, 2020 """ import os import ar...
2,732
27.175258
80
py
speechbrain
speechbrain-main/recipes/WHAMandWHAMR/meta/wham_room.py
import numpy as np import pyroomacoustics as pra from pyroomacoustics.parameters import constants from scipy.signal import resample_poly class WhamRoom(pra.room.ShoeBox): """ This class is taken from the original WHAMR! scripts. The original script can be found in http://wham.whisper.ai/ This cla...
3,202
26.612069
90
py
speechbrain
speechbrain-main/recipes/WHAMandWHAMR/enhancement/create_whamr_rirs.py
../meta/create_whamr_rirs.py
28
28
28
py
speechbrain
speechbrain-main/recipes/WHAMandWHAMR/enhancement/dynamic_mixing.py
import speechbrain as sb import numpy as np import torch import torchaudio import glob import os from pathlib import Path import random from speechbrain.processing.signal_processing import rescale from speechbrain.dataio.batch import PaddedBatch """ The functions to implement Dynamic Mixing For SpeechSeparation Autho...
7,223
30.964602
107
py
speechbrain
speechbrain-main/recipes/WHAMandWHAMR/enhancement/prepare_data.py
../prepare_data.py
18
18
18
py
speechbrain
speechbrain-main/recipes/WHAMandWHAMR/enhancement/preprocess_dynamic_mixing.py
../meta/preprocess_dynamic_mixing.py
36
36
36
py
speechbrain
speechbrain-main/recipes/WHAMandWHAMR/enhancement/wham_room.py
../meta/wham_room.py
20
20
20
py
speechbrain
speechbrain-main/recipes/WHAMandWHAMR/enhancement/train.py
#!/usr/bin/env/python3 """Recipe for training a neural speech separation system on WHAM! and WHAMR! datasets. The system employs an encoder, a decoder, and a masking network. To run this recipe, do the following: > python train.py hparams/sepformer-wham.yaml --data_folder /your_path/wham_original > python train.py hpa...
29,072
36.465206
108
py
speechbrain
speechbrain-main/recipes/LibriParty/VAD/commonlanguage_prepare.py
import os import logging import torchaudio import speechbrain as sb from speechbrain.utils.data_utils import get_all_files logger = logging.getLogger(__name__) COMMON_LANGUAGE_URL = ( "https://zenodo.org/record/5036977/files/CommonLanguage.tar.gz?download=1" ) def prepare_commonlanguage(folder, csv_file, max_no...
3,586
36.757895
78
py
speechbrain
speechbrain-main/recipes/LibriParty/VAD/data_augment.py
"""This library is used to create data on-the-fly for VAD. Authors * Mirco Ravanelli 2020 """ import torch import torchaudio import random # fade-in/fade-out definition fade_in = torchaudio.transforms.Fade(fade_in_len=1000, fade_out_len=0) fade_out = torchaudio.transforms.Fade(fade_in_len=0, fade_out_len=1000) de...
13,096
29.45814
83
py
speechbrain
speechbrain-main/recipes/LibriParty/VAD/musan_prepare.py
import os import logging import torchaudio import speechbrain as sb from speechbrain.utils.data_utils import get_all_files logger = logging.getLogger(__name__) def prepare_musan(folder, music_csv, noise_csv, speech_csv, max_noise_len=None): """Prepare the musan dataset (music, noise, speech). Arguments ...
3,700
37.154639
80
py
speechbrain
speechbrain-main/recipes/LibriParty/VAD/train.py
#!/usr/bin/env python3 """ Recipe for training a Voice Activity Detection (VAD) model on LibriParty. This code heavily relis on data augmentation with external datasets. (e.g, open_rir, musan, CommonLanguge is used as well). Make sure you download all the datasets before staring the experiment: - LibriParty: https://d...
9,259
30.931034
96
py
speechbrain
speechbrain-main/recipes/LibriParty/VAD/libriparty_prepare.py
""" This script prepares the data-manifest files (in JSON format) for training and testing a Voice Activity Detection system with the LibriParty dataset. The dataset contains sequences of 1-minutes of LibiSpeech sentences corrupted by noise and reverberation. The dataset can be downloaded from here: https://drive.goo...
9,595
30.155844
82
py
speechbrain
speechbrain-main/recipes/LibriParty/generate_dataset/get_dataset_from_metadata.py
""" LibriParty Dataset creation by using official metadata. Author ------ Samuele Cornell, 2020 Mirco Ravanelli, 2020 """ import os import sys import speechbrain as sb from hyperpyyaml import load_hyperpyyaml from speechbrain.utils.data_utils import download_file from local.create_mixtures_from_metadata import create...
1,357
27.291667
77
py
speechbrain
speechbrain-main/recipes/LibriParty/generate_dataset/download_required_data.py
""" Source datasets downloading script for LibriParty. Author ------ Samuele Cornell, 2020 """ import argparse import os from speechbrain.utils.data_utils import download_file from local.resample_folder import resample_folder LIBRISPEECH_URLS = [ "http://www.openslr.org/resources/12/test-clean.tar.gz", "http...
3,072
36.47561
168
py
speechbrain
speechbrain-main/recipes/LibriParty/generate_dataset/create_custom_dataset.py
""" Custom LibriParty creation script with user specified parameters. Author ------ Samuele Cornell, 2020 """ import os import sys import json import random import numpy as np import speechbrain as sb from hyperpyyaml import load_hyperpyyaml from speechbrain.utils.data_utils import get_all_files from local.create_mi...
3,971
30.03125
79
py
speechbrain
speechbrain-main/recipes/LibriParty/generate_dataset/local/resample_folder.py
""" This script allows to resample a folder which contains audio files. The files are parsed recursively. An exact copy of the folder is created, with same structure but contained resampled audio files. Resampling is performed by using sox through torchaudio. Author ------ Samuele Cornell, 2020 """ import os import a...
2,091
29.318841
79
py
speechbrain
speechbrain-main/recipes/LibriParty/generate_dataset/local/create_mixtures_metadata.py
""" This file contains functions to create json metadata used to create mixtures which simulate a multi-party conversation in a noisy scenario. Author ------ Samuele Cornell, 2020 """ import numpy as np from pathlib import Path import json import os from tqdm import tqdm import torchaudio def _read_metadata(file_p...
7,619
35.285714
80
py
speechbrain
speechbrain-main/recipes/LibriParty/generate_dataset/local/create_mixtures_from_metadata.py
""" This file contains functions to create mixtures given json metadata. The mixtures simulate a multi-party conversation in a noisy scenario. Author ------ Samuele Cornell, 2020 """ import os import torch import json import numpy as np import torchaudio from speechbrain.processing.signal_processing import rescale, ...
6,540
33.246073
80
py
speechbrain
speechbrain-main/recipes/LibriParty/generate_dataset/local/__init__.py
0
0
0
py
speechbrain
speechbrain-main/recipes/WSJ0Mix/prepare_data.py
""" The .csv preperation functions for WSJ0-Mix. Author * Cem Subakan 2020 """ import os import csv def prepare_wsjmix( datapath, savepath, n_spks=2, skip_prep=False, librimix_addnoise=False, fs=8000, ): """ Prepared wsj2mix if n_spks=2 and wsj3mix if n_spks=3. Arguments: ...
7,573
30.427386
102
py
speechbrain
speechbrain-main/recipes/WSJ0Mix/separation/dynamic_mixing.py
import speechbrain as sb import numpy as np import torch import torchaudio import glob import os from pathlib import Path import random from speechbrain.processing.signal_processing import rescale from speechbrain.dataio.batch import PaddedBatch """ The functions to implement Dynamic Mixing For SpeechSeparation Autho...
7,309
32.378995
93
py
speechbrain
speechbrain-main/recipes/WSJ0Mix/separation/prepare_data.py
../prepare_data.py
18
18
18
py
speechbrain
speechbrain-main/recipes/WSJ0Mix/separation/preprocess_dynamic_mixing.py
../meta/preprocess_dynamic_mixing.py
36
36
36
py
speechbrain
speechbrain-main/recipes/WSJ0Mix/separation/train.py
#!/usr/bin/env/python3 """Recipe for training a neural speech separation system on wsjmix the dataset. The system employs an encoder, a decoder, and a masking network. To run this recipe, do the following: > python train.py hparams/sepformer.yaml > python train.py hparams/dualpath_rnn.yaml > python train.py hparams/co...
23,418
35.706897
108
py
speechbrain
speechbrain-main/recipes/WSJ0Mix/meta/preprocess_dynamic_mixing.py
""" This script allows to resample a folder which contains audio files. The files are parsed recursively. An exact copy of the folder is created, with same structure but contained resampled audio files. Resampling is performed by using sox through torchaudio. Author ------ Samuele Cornell, 2020 """ import os import ar...
2,732
27.175258
80
py
speechbrain
speechbrain-main/recipes/VoxCeleb/voxceleb_prepare.py
""" Data preparation. Download: http://www.robots.ox.ac.uk/~vgg/data/voxceleb/ """ import os import csv import logging import glob import random import shutil import sys # noqa F401 import numpy as np import torch import torchaudio from tqdm.contrib import tqdm from speechbrain.dataio.dataio import ( load_pkl, ...
16,001
29.192453
103
py
speechbrain
speechbrain-main/recipes/VoxCeleb/SpeakerRec/train_speaker_embeddings.py
#!/usr/bin/python3 """Recipe for training speaker embeddings (e.g, xvectors) using the VoxCeleb Dataset. We employ an encoder followed by a speaker classifier. To run this recipe, use the following command: > python train_speaker_embeddings.py {hyperparameter_file} Using your own hyperparameter file or one of the fol...
8,833
33.108108
85
py
speechbrain
speechbrain-main/recipes/VoxCeleb/SpeakerRec/speaker_verification_cosine.py
#!/usr/bin/python3 """Recipe for training a speaker verification system based on cosine distance. The cosine distance is computed on the top of pre-trained embeddings. The pre-trained model is automatically downloaded from the web if not specified. This recipe is designed to work on a single GPU. To run this recipe, r...
9,905
33.515679
85
py
speechbrain
speechbrain-main/recipes/VoxCeleb/SpeakerRec/speaker_verification_plda.py
#!/usr/bin/python3 """Recipe for training a speaker verification system based on PLDA using the voxceleb dataset. The system employs a pre-trained model followed by a PLDA transformation. The pre-trained model is automatically downloaded from the web if not specified. To run this recipe, run the following command: ...
12,496
32.414439
94
py
speechbrain
speechbrain-main/recipes/VoxCeleb/SpeakerRec/voxceleb_prepare.py
../voxceleb_prepare.py
22
22
22
py
speechbrain
speechbrain-main/recipes/TIMIT/timit_prepare.py
""" Data preparation. Download: https://catalog.ldc.upenn.edu/LDC93S1 Authors * Mirco Ravanelli 2020 * Elena Rastorgueva 2020 """ import os import json import logging from speechbrain.utils.data_utils import get_all_files from speechbrain.dataio.dataio import read_audio logger = logging.getLogger(__name__) SAMPLERA...
15,072
26.809963
83
py
speechbrain
speechbrain-main/recipes/TIMIT/ASR/transducer/train_wav2vec.py
#!/usr/bin/env/python3 """Recipe for training a phoneme recognizer with Transducer loss on the TIMIT dataset. To run this recipe, do the following: > python train.py hparams/train.yaml --data_folder /path/to/TIMIT Authors * Abdel Heba 2020 * Mirco Ravanelli 2020 * Ju-Chieh Chou 2020 """ import os import sys impor...
12,544
32.632708
83
py
speechbrain
speechbrain-main/recipes/TIMIT/ASR/transducer/timit_prepare.py
../../timit_prepare.py
22
22
22
py
speechbrain
speechbrain-main/recipes/TIMIT/ASR/transducer/train.py
#!/usr/bin/env/python3 """Recipe for training a phoneme recognizer with Transducer loss on the TIMIT dataset. To run this recipe, do the following: > python train.py hparams/train.yaml --data_folder /path/to/TIMIT Authors * Abdel Heba 2020 * Mirco Ravanelli 2020 * Ju-Chieh Chou 2020 """ import os import sys impor...
10,118
33.301695
83
py
speechbrain
speechbrain-main/recipes/TIMIT/ASR/seq2seq_knowledge_distillation/train_kd.py
#!/usr/bin/env python3 """Recipe for doing ASR with phoneme targets and joint seq2seq and CTC loss on the TIMIT dataset following a knowledge distillation scheme as reported in " Distilling Knowledge from Ensembles of Acoustic Models for Joint CTC-Attention End-to-End Speech Recognition", Yan Gao et al. To run this r...
18,522
34.081439
81
py
speechbrain
speechbrain-main/recipes/TIMIT/ASR/seq2seq_knowledge_distillation/timit_prepare.py
../../timit_prepare.py
22
22
22
py
speechbrain
speechbrain-main/recipes/TIMIT/ASR/seq2seq_knowledge_distillation/save_teachers.py
#!/usr/bin/env python3 """Recipe for doing ASR with phoneme targets and joint seq2seq and CTC loss on the TIMIT dataset following a knowledge distillation scheme as reported in " Distilling Knowledge from Ensembles of Acoustic Models for Joint CTC-Attention End-to-End Speech Recognition", Yan Gao et al. To run this r...
14,025
34.329975
152
py
speechbrain
speechbrain-main/recipes/TIMIT/ASR/seq2seq_knowledge_distillation/train_teacher.py
#!/usr/bin/env python3 """Recipe for doing ASR with phoneme targets and joint seq2seq and CTC loss on the TIMIT dataset following a knowledge distillation scheme as reported in " Distilling Knowledge from Ensembles of Acoustic Models for Joint CTC-Attention End-to-End Speech Recognition", Yan Gao et al. To run this re...
11,903
34.323442
80
py
speechbrain
speechbrain-main/recipes/TIMIT/ASR/seq2seq/timit_prepare.py
../../timit_prepare.py
22
22
22
py
speechbrain
speechbrain-main/recipes/TIMIT/ASR/seq2seq/train_with_wav2vec2.py
#!/usr/bin/env python3 """Recipe for training a phoneme recognizer on TIMIT. The system relies on an encoder, a decoder, and attention mechanisms between them. Training is done with NLL. CTC loss is also added on the top of the encoder. Greedy search is using for validation, while beamsearch is used at test time to imp...
13,829
33.575
83
py