trw.transforms.flip

Module Contents

Functions

flip(array, axis)

Flip an axis of an array

transform_batch_random_flip(array, axis, flip_probability=0.5, flip_choices=None)

Randomly flip an image with a given probability

transform_batch_random_flip_joint(arrays, axis, flip_probability=0.5)

Randomly flip a joint images with a given probability

trw.transforms.flip.flip(array, axis)

Flip an axis of an array

Parameters
  • array – a numpy.ndarray or torch.Tensor n-dimensional array

  • axis – the xis to flip

Returns

an array with specified axis flipped

trw.transforms.flip.transform_batch_random_flip(array, axis, flip_probability=0.5, flip_choices=None)

Randomly flip an image with a given probability

Parameters
  • array – a numpy.ndarray or torch.Tensor n-dimensional array. Samples are stored on axis 0

  • axis – the axis to flip

  • flip_probability – the probability that a sample is flipped

  • flip_choices – for each sample, True or False to indicate if the sample is flipped or not

Returns

an array

trw.transforms.flip.transform_batch_random_flip_joint(arrays, axis, flip_probability=0.5)

Randomly flip a joint images with a given probability

Parameters
  • arrays – a list of a numpy.ndarray or torch.Tensor n-dimensional array. Samples for each array are stored on axis 0

  • axis – the axis to flip

  • flip_probability – the probability that a sample is flipped

Returns

an array