Update dataset.py

This commit is contained in:
aufr33 2021-07-07 10:16:19 +03:00 committed by GitHub
parent e328910fd2
commit 520e28227a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -85,7 +85,7 @@ def augment(X, y, reduction_rate, reduction_mask, mixup_rate, mixup_alpha, mp):
if np.random.uniform() < reduction_rate: if np.random.uniform() < reduction_rate:
y[idx] = spec_utils.reduce_vocal_aggressively(X[idx], y[idx], reduction_mask) y[idx] = spec_utils.reduce_vocal_aggressively(X[idx], y[idx], reduction_mask)
if not any([mp.param["mid_side"], mp.param["mid_side_b"], mp.param["mid_side_c"]]): if not any([mp.param["mid_side"], mp.param["mid_side_b"], mp.param["mid_side_b2"]]):
if np.random.uniform() < 0.5: if np.random.uniform() < 0.5:
# swap channel # swap channel
X[idx] = X[idx, ::-1] X[idx] = X[idx, ::-1]