4 import scipy
.io
.wavfile
as wav
6 from python_speech_featuresimport mfcc
8 from keras
.models
import model_from_json
10 modelfile
= sys
.argv
[1]
11 hdf5file
= '{}.hdf5'.format(modelfile
[-4:])
13 with
open(modelfile
, 'r') as f
:
15 model
= model_from_json(json
)
16 model
.load_weights(hdf5file
)
19 loss
='binary_crossentropy',
23 (rate
, sig
) = wav
.read(sys
.stdin
.buffer)
24 data
= mfcc(sig
, rate
, winlen
25 for i
in model
.predict(dat
, batch_size
=32, verbose
=0):