Skip to content
Snippets Groups Projects
Commit 025eeff6 authored by Pavel KORSHUNOV's avatar Pavel KORSHUNOV
Browse files

spport features input

parent 3e7f6233
No related branches found
No related tags found
No related merge requests found
Pipeline #
......@@ -135,3 +135,13 @@ class DiskAudio(Base):
final_frames.append(numpy.ravel(windows[i - self.context_size:i + self.context_size + 1]))
return final_frames, final_labels
def split_features_in_windows(self, features, label, wind_size):
m_total_length = len(features)
m_num_win = int(m_total_length / wind_size) # discard the tail of the signal
# make sure the array is divided into equal chunks
windows = numpy.split(features[:int(self.m_win_length) * int(m_num_win)], int(m_num_win))
windows_labels = [label] * m_num_win
return windows, windows_labels
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment