updated data

This commit is contained in:
k 2025-11-08 00:10:50 -05:00
parent 1a328d313f
commit c84c100cb8
2 changed files with 8 additions and 4 deletions

View File

@ -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)

View File

@ -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)