torch_concepts.data.utils.affine_transform

affine_transform(images, degrees, scales, batch_size=512)[source]

Apply affine transformations to a batch of images.

Applies rotation and scaling transformations to each image.

Parameters:
  • images – Tensor of shape (N, H, W) or (N, 3, H, W).

  • degrees – Tensor of shape (N) containing rotation degrees.

  • scales – Tensor of shape (N) containing scaling factors.

  • batch_size – Number of images to process at once (default: 512).

Returns:

Transformed images with same shape as input.

Return type:

Tensor