From: Mart Lubbers Date: Mon, 20 Mar 2017 20:42:39 +0000 (+0100) Subject: update X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=172083a4556e5009272df7729b5f9a1c564aaf49;p=asr1617data.git update --- diff --git a/makevenv.sh b/makevenv.sh index 2c6332d..d8cf5a8 100755 --- a/makevenv.sh +++ b/makevenv.sh @@ -1,6 +1,7 @@ #!/bin/bash +deactivate || true virtualenv -p python3 . . bin/activate -pip install --upgrade keras tensorflow h5py +pip install --upgrade keras tensorflow h5py python_speech_features pympi-ling scipy pip install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/protobuf-3.1.0-cp35-none-linux_x86_64.whl deactivate diff --git a/mfcc.py b/mfcc.py index 5e0b4b9..4bc7033 100644 --- a/mfcc.py +++ b/mfcc.py @@ -3,5 +3,5 @@ import scipy.io.wavfile as wav import sys (rate, sig) = wav.read(sys.stdin.buffer) -for i in mfcc(sig, rate, winlen=0.100, winstep=0.025, numcep=13, appendEnergy=True): +for i in mfcc(sig, rate, winlen=0.025, winstep=0.01, numcep=13, appendEnergy=True): print(*i, sep='\t') diff --git a/preprocess.sh b/preprocess.sh index 7522f1e..6543202 100644 --- a/preprocess.sh +++ b/preprocess.sh @@ -12,7 +12,7 @@ for f in orig/*.flac; do while [ $(jobs -p | wc -l) -ge $MAXPROCS ]; do sleep 1; done echo $f - BN="$(echo $f | grep -Po "(?<=/[0-9][0-9] - ).*(?=\.flac)")" + BN="$(echo $f | grep -Po "(?<=/[0-9][0-9]_-_).*(?=\.flac)")" NUM="$(printf '%02d' "$i")" WAV="wav/$NUM.wav" MFCC="mfcc/$NUM.mfcc" diff --git a/segment.py b/segment.py index 5454ad0..3a7967f 100644 --- a/segment.py +++ b/segment.py @@ -27,7 +27,7 @@ def process(num, *args): data.append([label] + l.split('\t')) # Increase time - currentframe += 0.025 + currentframe += 0.01 if __name__ == '__main__': diff --git a/train.py b/train.py index e9df911..a4ecbbc 100644 --- a/train.py +++ b/train.py @@ -5,7 +5,6 @@ from keras.layers import Dense, Dropout # , Activation model = Sequential() model.add(Dense(26, input_shape=(13,), activation='relu')) -model.add(Dropout(0.5)) model.add(Dense(1, activation='sigmoid')) model.compile( @@ -23,5 +22,3 @@ model.fit(dat, lab, epochs=10, batch_size=32) with open('model.json', 'w') as f: f.write(model.to_json()) model.save_weights('model.hdf5') - -