update
authorMart Lubbers <mart@martlubbers.net>
Mon, 20 Mar 2017 20:42:39 +0000 (21:42 +0100)
committerMart Lubbers <mart@martlubbers.net>
Mon, 20 Mar 2017 20:42:39 +0000 (21:42 +0100)
makevenv.sh
mfcc.py
preprocess.sh
segment.py
train.py

index 2c6332d..d8cf5a8 100755 (executable)
@@ -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 (file)
--- 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')
index 7522f1e..6543202 100644 (file)
@@ -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"
index 5454ad0..3a7967f 100644 (file)
@@ -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__':
index e9df911..a4ecbbc 100644 (file)
--- 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')
-
-