#!/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
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')
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"
data.append([label] + l.split('\t'))
# Increase time
- currentframe += 0.025
+ currentframe += 0.01
if __name__ == '__main__':
model = Sequential()
model.add(Dense(26, input_shape=(13,), activation='relu'))
-model.add(Dropout(0.5))
model.add(Dense(1, activation='sigmoid'))
model.compile(
with open('model.json', 'w') as f:
f.write(model.to_json())
model.save_weights('model.hdf5')
-
-