whylogs.features.transforms

Module Contents

Classes

ComposeTransforms

Outputs the composition of each transformation passed in transforms

Brightness

Outputs the Brightness of each pixel in the image

Saturation

Summary

Resize

Helper Transform to resize images.

Hue

SimpleBlur

Simple Blur Ammount computation based on variance of laplacian

Attributes

logger

ImageType

whylogs.features.transforms.logger
whylogs.features.transforms.ImageType
class whylogs.features.transforms.ComposeTransforms(transforms: List, name=None)

Outputs the composition of each transformation passed in transforms

__call__(self, x)
__repr__(self)

Return repr(self).

class whylogs.features.transforms.Brightness

Outputs the Brightness of each pixel in the image

__call__(self, img: Union[PIL.Image.Image, numpy.ndarray]) numpy.ndarray
Parameters

img (Union[Image, np.ndarray]) – Either a PIL image or numpy array with int8 values

Returns

Converted image.

Return type

np.ndarray

Deleted Parameters:

pic (PIL Image or numpy.ndarray): Image to be converted to tensor.

__repr__(self)

Return repr(self).

class whylogs.features.transforms.Saturation

Summary Outputs the saturation of each pixel in the image

__call__(self, img: Union[PIL.Image.Image, numpy.ndarray]) numpy.ndarray
Parameters

img (Union[Image, np.ndarray]) – Either a PIL image or numpy array with int8 values

Returns

(1,number_pixels) array for saturation values for the image

Return type

np.ndarray

__repr__(self)

Return repr(self).

class whylogs.features.transforms.Resize(size)

Helper Transform to resize images.

size

Description

Type

TYPE

__call__(self, img: Union[PIL.Image.Image, numpy.ndarray]) numpy.ndarray
Parameters

img (Union[ImageType, np.ndarray]) – Description

Returns

Description

Return type

np.ndarray

__repr__(self)

Return repr(self).

class whylogs.features.transforms.Hue
__call__(self, img: Union[PIL.Image.Image, numpy.ndarray]) numpy.ndarray
Parameters

img (Union[Image, np.ndarray]) – Either a PIL image or numpy array with int8 values

Returns

(1,number_pixels) array for hue values for the image

Return type

np.ndarray

__repr__(self)

Return repr(self).

class whylogs.features.transforms.SimpleBlur

Simple Blur Ammount computation based on variance of laplacian Overall metric of how blurry is the image. No overall scale.

__call__(self, img: Union[PIL.Image.Image, numpy.ndarray]) float
Parameters

img (Union[Image, np.ndarray]) – Either a PIL image or numpy array with int8 values

Returns

variance of laplacian of image.

Return type

float

__repr__(self)

Return repr(self).