From ebae65cdfa9aaac3a4d4b17d4604b9dc746bee8f Mon Sep 17 00:00:00 2001 From: Mart Lubbers Date: Tue, 16 May 2017 20:17:09 +0200 Subject: [PATCH] clean up prediction --- predict.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/predict.py b/predict.py index 18a84e7..45e94da 100644 --- a/predict.py +++ b/predict.py @@ -19,10 +19,12 @@ with open(modelfile, 'r', encoding='utf-8') as f: model = model_from_json(json) model.load_weights(hdf5file) -(_, winlen, winstep, _) = modelfile.split('_') +(_, winlen, winstep, name) = modelfile.split('_') winlen = float(winlen) winstep = float(winstep) +multiclass = name == 'multi' + model.compile( loss='binary_crossentropy', optimizer='rmsprop', @@ -49,12 +51,5 @@ print('sr: ', int(1.0/winstep)) print("len(wavdata): ", len(wavdata)) print("len(x): ", len(x)) wav.write('class.wav', int(1.0/winstep), wavdata) -#for i in smoothed: -# print(int(i*255)) - - - - - tgob.to_file('/dev/stdout') -- 2.20.1