mindspore.dataset.vision.AdjustBrightness
- class mindspore.dataset.vision.AdjustBrightness(brightness_factor)[source]
Adjust the brightness of the input image.
- Parameters
brightness_factor (float) – How much to adjust the brightness, must be non negative.
0
gives a black image,1
gives the original image, while2
increases the brightness by a factor of 2.- Raises
TypeError – If brightness_factor is not of type float.
ValueError – If brightness_factor is less than 0.
RuntimeError – If shape of the input image is not <H, W, C>.
- Supported Platforms:
CPU
Ascend
Examples
>>> import mindspore.dataset as ds >>> import mindspore.dataset.vision as vision >>> >>> image_folder_dataset = ds.ImageFolderDataset("/path/to/image_folder_dataset_directory") >>> transforms_list = [vision.Decode(), vision.AdjustBrightness(brightness_factor=2.0)] >>> image_folder_dataset = image_folder_dataset.map(operations=transforms_list, ... input_columns=["image"])
- Tutorial Examples:
- device(device_target='CPU')[source]
Set the device for the current operator execution.
- Parameters
device_target (str, optional) – The operator will be executed on this device. Currently supports
CPU
. Default:CPU
.- Raises
TypeError – If device_target is not of type str.
ValueError – If device_target is not
CPU
.
- Supported Platforms:
CPU
Examples
>>> import mindspore.dataset as ds >>> import mindspore.dataset.vision as vision >>> >>> image_folder_dataset = ds.ImageFolderDataset("/path/to/image_folder_dataset_directory") >>> transforms_list = [vision.Decode().device("CPU"), vision.AdjustBrightness(2.0).device("Ascend")] >>> image_folder_dataset = image_folder_dataset.map(operations=transforms_list, input_columns=["image"])
- Tutorial Examples: