mindspore.dataset.audio.MaskAlongAxisIID
- class mindspore.dataset.audio.MaskAlongAxisIID(mask_param, mask_value, axis)[source]
Apply a mask along axis. Mask will be applied from indices [mask_start, mask_start + mask_width), where mask_width is sampled from uniform[0, mask_param], and mask_start from uniform[0, max_length - mask_width], max_length is the number of columns of the specified axis of the spectrogram.
- Parameters
Examples
>>> import numpy as np >>> >>> waveform= np.random.random([1, 20, 20]) >>> numpy_slices_dataset = ds.NumpySlicesDataset(data=waveform, column_names=["audio"]) >>> transforms = [audio.MaskAlongAxisIID(5, 0.5, 2)] >>> numpy_slices_dataset = numpy_slices_dataset.map(operations=transforms, input_columns=["audio"])