updated data
This commit is contained in:
parent
1a328d313f
commit
c84c100cb8
2 changed files with 8 additions and 4 deletions
3
data.py
3
data.py
|
|
@ -22,6 +22,9 @@ def process_file(file_path):
|
|||
end = start_pos + size
|
||||
if end <= sample_len:
|
||||
chunk = y[start_pos:end]
|
||||
chunk = librosa.feature.melspectrogram(y=chunk, sr=SAMPLE_RATE)
|
||||
chunk = ((librosa.amplitude_to_db(chunk,ref=np.max)+80)/80)
|
||||
|
||||
#chunk = librosa.feature.melspectrogram(y=chunk,sr=SAMPLE_RATE)
|
||||
#chunk = ((librosa.amplitude_to_db(chunk,ref=np.max)+40)/40)
|
||||
file_chunks.append(chunk)
|
||||
|
|
|
|||
|
|
@ -1,13 +1,14 @@
|
|||
import data
|
||||
import numpy as np
|
||||
|
||||
x,y = data.dataset(data.load())
|
||||
x = data.load()
|
||||
size=len(x)
|
||||
print(size)
|
||||
|
||||
x_np = np.stack(x)
|
||||
x_np = np.expand_dims(x_np, axis=1)
|
||||
|
||||
y_np = np.stack(y)
|
||||
y_np = np.expand_dims(y_np, axis=1)
|
||||
#y_np = np.stack(y)
|
||||
#y_np = np.expand_dims(y_np, axis=1)
|
||||
|
||||
np.savez_compressed("data",x_np,y_np)
|
||||
np.savez_compressed("data",x_np)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue