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 numpy as np | |
import random | |
import itertools | |
import librosa | |
import IPython.display as ipd | |
import matplotlib.pyplot as plt | |
def stretch(data,rate=1): | |
input_length = 440000 | |
data=librosa.effects.time_stretch(data,rate) |
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 numpy as np | |
import random | |
import itertools | |
import librosa | |
import IPython.display as ipd | |
import matplotlib.pyplot as plt | |
def load_audio_file(file_path): | |
input_length = 440000 |
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 numpy as np | |
import random | |
import itertools | |
import librosa | |
import IPython.display as ipd | |
import matplotlib.pyplot as plt | |
def stretch(data,rate=1): | |
input_length = 440000 | |
data=librosa.effects.time_stretch(data,rate) |
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 numpy as np | |
import random | |
import itertools | |
import librosa | |
import IPython.display as ipd | |
import matplotlib.pyplot as plt | |
def load_audio_file(file_path): | |
input_length = 440000 |
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
uemura_normal_007.wav | uemura | |
---|---|---|
tsuchiya_normal_011.wav | tsuchiya | |
tsuchiya_angry_014.wav | tsuchiya | |
uemura_normal_054.wav | uemura | |
tsuchiya_normal_010.wav | tsuchiya | |
tsuchiya_happy_005.wav | tsuchiya | |
tsuchiya_normal_095.wav | tsuchiya | |
uemura_normal_099.wav | uemura | |
tsuchiya_happy_096.wav | tsuchiya | |
uemura_happy_094.wav | uemura |
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
fname | label | |
---|---|---|
tsuchiya_angry_008.wav | tsuchiya | |
tsuchiya_normal_058.wav | tsuchiya | |
fujitou_normal_091.wav | fujitou | |
fujitou_normal_009.wav | fujitou | |
fujitou_happy_068.wav | fujitou | |
tsuchiya_normal_045.wav | tsuchiya | |
fujitou_normal_054.wav | fujitou | |
uemura_normal_086.wav | uemura | |
fujitou_angry_093.wav | fujitou |
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 | |
class Config: | |
def __init__(self,mode='conv',nfilt=26,nfeat=13,nfft=2048,rate=44100): | |
self.mode=mode | |
self.nfilt=nfilt | |
self.nfeat=nfeat | |
self.nfft=nfft | |
self.rate=rate | |
self.step=int(rate/10) | |
self.model_path=os.path.join('models',mode+'.model') |
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 | |
from tqdm import tqdm | |
import pandas as pd | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from scipy.io import wavfile | |
from python_speech_features import mfcc, logfbank | |
import librosa | |
import glob | |
import sklearn |
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 | |
from scipy.io import wavfile | |
import pandas as pd | |
import matplotlib.pyplot as plt | |
import numpy as np | |
from keras.layers import Conv2D, MaxPool2D, Flatten, LSTM | |
from keras.layers import Dropout, Dense, TimeDistributed | |
from keras.models import load_model | |
from keras.utils import to_categorical | |
from sklearn.utils.class_weight import compute_class_weight |
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 | |
from scipy.io import wavfile | |
import pandas as pd | |
import matplotlib.pyplot as plt | |
import numpy as np | |
from keras.layers import Conv2D, MaxPool2D, Flatten, LSTM | |
from keras.layers import Dropout, Dense, TimeDistributed | |
from keras.models import Sequential | |
from keras.utils import to_categorical | |
from sklearn.utils.class_weight import compute_class_weight |
NewerOlder