From: Mart Lubbers Date: Tue, 16 May 2017 18:17:09 +0000 (+0200) Subject: clean up prediction X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=ebae65cdfa9aaac3a4d4b17d4604b9dc746bee8f;p=asr1617data.git clean up prediction --- 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')