mindspore.dataset.audio.MaskAlongAxis
- class mindspore.dataset.audio.MaskAlongAxis(mask_start, mask_width, mask_value, axis)[source]
Apply a mask along axis . Mask will be applied from indices [mask_start, mask_start + mask_width) .
- Parameters
- Raises
ValueError – If mask_start is invalid (< 0).
ValueError – If mask_width is invalid (< 1).
ValueError – If axis is not type of int or not within [1, 2].
- Supported Platforms:
CPU
Examples
>>> import numpy as np >>> import mindspore.dataset as ds >>> import mindspore.dataset.audio as audio >>> >>> waveform = np.random.random([1, 20, 20]) >>> numpy_slices_dataset = ds.NumpySlicesDataset(data=waveform, column_names=["audio"]) >>> transforms = [audio.MaskAlongAxis(0, 10, 0.5, 1)] >>> numpy_slices_dataset = numpy_slices_dataset.map(operations=transforms, input_columns=["audio"])
- Tutorial Examples: