This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask | |
from flask import request | |
from flask import jsonify | |
app = Flask(__name__) | |
@app.route("/") | |
def index(): | |
return "Welcome" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import glob | |
from shutil import copyfile | |
from subprocess import Popen | |
base_dir = '/Tmp/sotelo/data/librispeech/' | |
raw_dir = os.path.join( | |
base_dir, 'downloads/LibriSpeech/train-clean-100') | |
wav_dir = os.path.join(base_dir, 'wav') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# From https://stackoverflow.com/questions/29547218/ | |
# remove-silence-at-the-beginning-and-at-the-end-of-wave-files-with-pydub | |
from pydub import AudioSegment | |
def detect_leading_silence(sound, silence_threshold=-50.0, chunk_size=10): | |
''' | |
sound is a pydub.AudioSegment | |
silence_threshold in dB | |
chunk_size in ms |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from run_merlin import prepare_file_path_list, read_file_list | |
from io_funcs.binary_io import BinaryIOCollection | |
import numpy | |
import h5py | |
import pickle | |
from fuel.datasets.hdf5 import H5PYDataset | |
io_fun = BinaryIOCollection() | |
n_outs = 63 # 187 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
All the traces of the processing are in leto11. | |
1. Extract data with pavoque-repo | |
1.5 Convert wav to 16k. I use ch_wave -otype riff -F 16000 -o wav/${X} wav48/${X} | |
2. Copy data in /Tmp/sotelo/data/german/raw | |
3. cd /Tmp/sotelo/results/merlin/egs/build_your_own_voice/s1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import glob | |
from shutil import copyfile | |
base_dir = '/Tmp/sotelo/data/german/raw' | |
text_dir = os.path.join(base_dir, 'text') | |
wav_dir = os.path.join(base_dir, 'wav/') | |
audio_files = [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from blocks.main_loop import MainLoop | |
from blocks.model import Model | |
from blocks.utils import shared_floatx_zeros, shared_floatx | |
from theano import tensor, config, function | |
from play.bricks.custom import (DeepTransitionFeedback, GMMEmitter, | |
SPF0Emitter) | |
from blocks.extensions.monitoring import TrainingDataMonitoring |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library("igraph") | |
num_layer = 7 | |
num_nodes = (num_layer+1)*num_layer/2 | |
M <-matrix(rep(0,num_nodes*num_nodes),nrow=num_nodes,ncol=num_nodes) | |
layout <- matrix(rep(0, 2*num_nodes), nrow=num_nodes) | |
node = 0 | |
for(layer in 1:num_layer){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from theano import tensor | |
from theano.ifelse import ifelse | |
from blocks.utils import shared_like | |
from blocks.monitoring.aggregation import AggregationScheme, Aggregator | |
class MeanAndVariance(AggregationScheme): | |
"""Aggregation scheme which computes the mean. | |
Parameters | |
---------- | |
numerator : :class:`~tensor.TensorVariable` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import theano | |
import numpy | |
from collections import OrderedDict | |
from fuel.datasets import IndexableDataset | |
from fuel.streams import DataStream | |
from fuel.schemes import SequentialScheme | |
from theano import tensor |
NewerOlder