Skip to content

Commit

Permalink
scary warning removal
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidDoukhan committed Jun 14, 2024
1 parent 345f6aa commit 1e63793
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion inaSpeechSegmenter/segmenter.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ def _get_patches(mspec, w, step):
h = mspec.shape[1]
data = vaw(mspec, (w,h), step=step)
data.shape = (len(data), w*h)
data = (data - np.mean(data, axis=1).reshape((len(data), 1))) / np.std(data, axis=1).reshape((len(data), 1))
with warnings.catch_warnings():
warnings.filterwarnings('ignore', message='invalid value encountered in subtract', category=RuntimeWarning)
data = (data - np.mean(data, axis=1).reshape((len(data), 1))) / np.std(data, axis=1).reshape((len(data), 1))
lfill = [data[0,:].reshape(1, h*w)] * (w // (2 * step))
rfill = [data[-1,:].reshape(1, h*w)] * (w // (2* step) - 1 + len(mspec) % 2)
data = np.vstack(lfill + [data] + rfill )
Expand Down

0 comments on commit 1e63793

Please sign in to comment.