clean up prediction
authorMart Lubbers <mart@martlubbers.net>
Tue, 16 May 2017 18:17:09 +0000 (20:17 +0200)
committerMart Lubbers <mart@martlubbers.net>
Tue, 16 May 2017 18:17:09 +0000 (20:17 +0200)
predict.py

index 18a84e7..45e94da 100644 (file)
@@ -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')