Hello, here is the page

Transformations

Transformation and data augmentation for Frames class from the aloception.scene package

class alodataset.transforms.AloTransform(same_on_sequence=True, same_on_frames=False)

Bases: object

sample_params()
set_params()
class alodataset.transforms.ColorJitter(*args, brightness=0.2, contrast=0.2, saturation=0.2, hue=0.2, **kwargs)

Bases: alodataset.transforms.AloTransform, torchvision.transforms.transforms.ColorJitter

apply(frame)

Apply the transformation on the frame

Parameters
frame: aloscene.Frame
Returns
n_frame: aloscene.Frame
sample_params()

Sample a size from the list of possible sizes

set_params(*params)

Given predefined params, set the params on the class

training: bool
class alodataset.transforms.Compose(transforms, *args, **kwargs)

Bases: alodataset.transforms.AloTransform

apply(frame)

Apply the transformation

Parameters
frame: Frame

Frame to apply the transformation on

sample_params()

Sample and set params of all the child transformations into the self.transforms list.

set_params(params)

Given predefined params, set the params to all the child transformations.

class alodataset.transforms.CustomRandomColoring(gamma_r=(0.8, 1.2), brightness_r=(0.5, 2.0), colors_r=(0.5, 1.5), *args, **kwargs)

Bases: alodataset.transforms.AloTransform

apply(frame)
sample_params()
class alodataset.transforms.RandomCrop(size, *args, **kwargs)

Bases: alodataset.transforms.AloTransform

apply(frame)
sample_params()
set_params(top, left)
class alodataset.transforms.RandomHorizontalFlip(p=0.5, *args, **kwargs)

Bases: alodataset.transforms.AloTransform

apply(frame)

Apply the transformation

Parameters
frame: Frame

Frame to apply the transformation on

sample_params()

Sample a number between and 1. The transformation will be aply if number is < self.p

set_params(_r)

Given predefined params, set the params on the class

class alodataset.transforms.RandomResizeWithAspectRatio(sizes, max_size=None, *args, **kwargs)

Bases: alodataset.transforms.AloTransform

apply(frame)

Apply the transformation

Parameters
frame: Frame

Frame to apply the transformation on

static get_size_with_aspect_ratio(frame, size, max_size=None)

Given a frame and a size this method compute a new size so that the largest side is equal to size and always < to max_size (if given).

Parameters
frameFrame

Frame to resize. Used only to get the width and the height of the target frame to resize.

size: int

Desired size

max_size: int

Maximum size of the largest side.

sample_params()

Sample a size from the list of possible sizes

set_params(_size)

Given predefined params, set the params on the class

class alodataset.transforms.RandomSelect(transforms1, transforms2, p=0.5, *args, **kwargs)

Bases: alodataset.transforms.AloTransform

apply(frame)

Apply the transformation

Parameters
frame: Frame

Frame to apply the transformation on

sample_params()

Sample a number between and 1. The first transformation will be aply if number is < self.p otherwise the second transformation is apply.

set_params(_r, param1, param2)

Given predefined params, set the params on the class

class alodataset.transforms.RandomSizeCrop(min_size, max_size, *args, **kwargs)

Bases: alodataset.transforms.AloTransform

apply(frame)

Apply the transformation

Parameters
frame: Frame

Frame to apply the transformation on

sample_params()

Sample a number between and 1. The transformation will be aply if number is < self.p

set_params(_w, _h)

Given predefined params, set the params on the class

class alodataset.transforms.RealisticNoise(gaussian_std=0.02, shot_std=0.2, *args, **kwargs)

Bases: alodataset.transforms.AloTransform

apply(frame)
sample_params()

No parameters to sample

set_params()

No parameters to set

class alodataset.transforms.Resize(size, *args, **kwargs)

Bases: alodataset.transforms.AloTransform

apply(frame)

Apply the transformation

Parameters
frame: Frame

Frame to apply the transformation on

sample_params()

Sample a size from the list of possible sizes

set_params(size)

Given predefined params, set the params on the class

class alodataset.transforms.SpatialShift(size, *args, **kwargs)

Bases: alodataset.transforms.AloTransform

apply(frame)

Apply the transformation

Parameters
frame: Frame

Frame to apply the transformation on

sample_params()

Sample a size from the list of possible sizes

set_params(percentage)

Given predefined params, set the params on the class