updated data
This commit is contained in:
parent
1a328d313f
commit
c84c100cb8
3
data.py
3
data.py
@ -22,6 +22,9 @@ def process_file(file_path):
|
|||||||
end = start_pos + size
|
end = start_pos + size
|
||||||
if end <= sample_len:
|
if end <= sample_len:
|
||||||
chunk = y[start_pos:end]
|
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.feature.melspectrogram(y=chunk,sr=SAMPLE_RATE)
|
||||||
#chunk = ((librosa.amplitude_to_db(chunk,ref=np.max)+40)/40)
|
#chunk = ((librosa.amplitude_to_db(chunk,ref=np.max)+40)/40)
|
||||||
file_chunks.append(chunk)
|
file_chunks.append(chunk)
|
||||||
|
|||||||
@ -1,13 +1,14 @@
|
|||||||
import data
|
import data
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
x,y = data.dataset(data.load())
|
x = data.load()
|
||||||
size=len(x)
|
size=len(x)
|
||||||
|
print(size)
|
||||||
|
|
||||||
x_np = np.stack(x)
|
x_np = np.stack(x)
|
||||||
x_np = np.expand_dims(x_np, axis=1)
|
x_np = np.expand_dims(x_np, axis=1)
|
||||||
|
|
||||||
y_np = np.stack(y)
|
#y_np = np.stack(y)
|
||||||
y_np = np.expand_dims(y_np, axis=1)
|
#y_np = np.expand_dims(y_np, axis=1)
|
||||||
|
|
||||||
np.savez_compressed("data",x_np,y_np)
|
np.savez_compressed("data",x_np)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user