cerebras.modelzoo.data.vision.segmentation.preprocessing_utils#

Functions

adjust_brightness_transform

Function equivalent to tf.image.adjust_brightness, but executed probabilistically. :params img: Input torch.Tensor of any shape :params p: Integer representing probability :params delta: Float value representing the value by which img Tensor is increased or decreased.

normalize_tensor_transform

Function to normalize img :params img: Input torch.Tensor of any shape :params normalize_data_method: One of "zero_centered" "zero_one" "standard_score"

resize_image_with_crop_or_pad_transform

Function equivalent to tf.image.resize_with_crop_or_pad :params img: torch.Tensor of shape (C, H, W) or (H, W) :params target_height: int value representing output image height :params target_width: int value representing output image width :returns torch.Tensor of shape (C, target_height, target_width)

rotation_90_transform

Function equivalent to tf.image.rot90 Rotates img in counter clockwise direction :params img: torch.Tensor of shape (C, H, W) or (H, W) :params num_rotations: int value representing number of counter clock-wise rotations of img

tile_image_transform

Function to tile image to tgt_height and target_width If target_height < image_height: image is not tiled in this dimension.