repositories
/
asr1617data.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
885b758
)
predict smoothing
master
author
Mart Lubbers
<mart@martlubbers.net>
Wed, 7 Jun 2017 14:37:35 +0000
(16:37 +0200)
committer
Mart Lubbers
<mart@martlubbers.net>
Wed, 7 Jun 2017 14:37:35 +0000
(16:37 +0200)
predict.py
patch
|
blob
|
history
diff --git
a/predict.py
b/predict.py
index
de1abc2
..
3e0e2f7
100644
(file)
--- a/
predict.py
+++ b/
predict.py
@@
-38,13
+38,13
@@
tier = tgob.add_tier('lyrics')
window_len = int(1.0/winstep)
x = model.predict(data, batch_size=32, verbose=0)
window_len = int(1.0/winstep)
x = model.predict(data, batch_size=32, verbose=0)
-
#
s = np.r_[x[window_len-1:0:-1],x,x[-2:-window_len-1:-1]]
-
#
w = np.hanning(window_len)
+s = np.r_[x[window_len-1:0:-1],x,x[-2:-window_len-1:-1]]
+w = np.hanning(window_len)
#
#
-
#
smoothed = np.convolve(w/w.sum(), s[:,0], mode='valid')
-
#
wavdata = np.uint8(list(map(int,
-
#
smoothed*255))[int(window_len/2):-1*(int(window_len/2))])
-wavdata = np.uint8(x*255)
+smoothed = np.convolve(w/w.sum(), s[:,0], mode='valid')
+wavdata = np.uint8(list(map(int,
+ smoothed*255))[int(window_len/2):-1*(int(window_len/2))])
+
#
wavdata = np.uint8(x*255)
print('sr: ', int(1.0/winstep))
print("len(wavdata): ", len(wavdata))
print('sr: ', int(1.0/winstep))
print("len(wavdata): ", len(wavdata))