stable_pretraining.data.transforms

stable_pretraining.data.transforms#

Functions

random_seed(seed)

set_seed(seeds)

to_image(input)

See ToImage for details.

Classes

AdditiveGaussian(sigma[, p])

Add Gaussian noise to input data.

CenterCrop(size[, source, target])

Crop the center of an image to the given size.

ColorJitter([brightness, contrast, ...])

Randomly change brightness, contrast, saturation, and hue of an image.

Compose(*args)

Compose multiple transforms together in sequence.

Conditional(transform, condition_key[, ...])

Apply transform conditionally based on a data dictionary key.

ControlledTransform(transform[, ...])

Face Landmarks dataset.

GaussianBlur(kernel_size[, sigma, p, ...])

Apply Gaussian blur to image with random sigma values.

MultiViewTransform(transforms)

Apply different transforms to different views of the same sample.

PILGaussianBlur([sigma, p, source, target])

PIL-based Gaussian blur transform with random sigma sampling.

RGB([source, target])

Convert image to RGB format.

RandomChannelPermutation([source, target])

Randomly permute the channels of an image.

RandomContiguousTemporalSampler(source, ...)

Randomly sample contiguous frames from a video sequence.

RandomCrop(size[, padding, pad_if_needed, ...])

Crop a random portion of image and resize it to given size.

RandomGrayscale([p, source, target])

Randomly convert image to grayscale with given probability.

RandomHorizontalFlip([p, source, target])

Horizontally flip the given image randomly with a given probability.

RandomResizedCrop(size[, scale, ratio, ...])

Crop a random portion of image and resize it to given size.

RandomRotation(degrees[, interpolation, ...])

Rotate image by random angle within specified degrees range.

RandomSolarize(threshold[, p, source, target])

Randomly solarize image by inverting pixel values above threshold.

Resize(size[, interpolation, max_size, ...])

Resize image to specified size.

ToImage([dtype, scale, mean, std, source, ...])

Convert input to image tensor with optional normalization.

Transform()

Base transform class extending torchvision v2.Transform with nested data handling.

UniformTemporalSubsample(num_samples[, ...])

nn.Module wrapper for pytorchvideo.transforms.functional.uniform_temporal_subsample.