RobustART.noise.utils package

Submodules

RobustART.noise.utils.add_noise_utils module

RobustART.noise.utils.add_noise_utils.add_noise_for_imagenet_c(image, severity=1, corruption_name=None, corruption_number=- 1)
RobustART.noise.utils.add_noise_utils.add_noise_for_imagenet_s(image, decoder_type='pil', resize_type='pil-bilinear', transform_type='val')

RobustART.noise.utils.imagenet_s_gen module

class RobustART.noise.utils.imagenet_s_gen.ImageTransfer(root_dir=None, meta_file=None, save_root=None, decoder_type='pil', resize_type='pil-bilinear', resize=224, transform_type='val', return_online=False, file_path=None)

Bases: object

PIL_resize(img, size, interpolation)
get_params(img, scale=(0.08, 1.0), ratio=(0.75, 1.3333333333333333))

Get parameters for crop for a random sized crop.

Args:

img (PIL Image): Image to be cropped. scale (tuple): range of size of the origin size cropped ratio (tuple): range of aspect ratio of the origin aspect ratio cropped

Returns:
tuple: params (i, j, h, w) to be passed to crop for a random

sized crop.

getimage(idx=None)
image_decoder(filebytes, filepath=None)
image_resize(img, y, x, h, w)
read_file(meta_dict)
toNumpy(img)
toPIL(img)

Module contents