mindspore.dataset.vision.TrivialAugmentWide
- class mindspore.dataset.vision.TrivialAugmentWide(num_magnitude_bins=31, interpolation=Inter.NEAREST, fill_value=0)[source]
Apply TrivialAugmentWide data augmentation method on the input image.
Refer to TrivialAugmentWide: Tuning-free Yet State-of-the-Art Data Augmentation .
Only support 3-channel RGB image.
- Parameters
num_magnitude_bins (int, optional) – The number of different magnitude values, must be greater than or equal to 2. Default: 31.
interpolation (Inter, optional) –
Image interpolation method. Default: Inter.NEAREST. It can be Inter.NEAREST, Inter.BILINEAR, Inter.BICUBIC or Inter.AREA.
Inter.NEAREST, nearest-neighbor interpolation.
Inter.BILINEAR, bilinear interpolation.
Inter.BICUBIC, bicubic interpolation.
Inter.AREA, pixel area interpolation.
fill_value (Union[int, tuple[int, int, int]], optional) – Pixel fill value for the area outside the transformed image, must be in range of [0, 255]. Default: 0. If int is provided, pad all RGB channels with this value. If tuple[int, int, int] is provided, pad R, G, B channels respectively.
- Raises
TypeError – If num_magnitude_bins is not of type int.
ValueError – If num_magnitude_bins is less than 2.
TypeError – If interpolation not of type
mindspore.dataset.vision.Inter
.TypeError – If fill_value is not of type int or tuple[int, int, int].
ValueError – If fill_value is not in range of [0, 255].
RuntimeError – If shape of the input image is not <H, W, C>.
- Supported Platforms:
CPU
Examples
>>> from mindspore.dataset.vision import AutoAugmentPolicy, Inter >>> >>> transforms_list = [vision.Decode(), ... vision.TrivialAugmentWide(num_magnitude_bins=31, ... interpolation=Inter.NEAREST, ... fill_value=0)] >>> image_folder_dataset = image_folder_dataset.map(operations=transforms_list, ... input_columns=["image"])