Skip to content
class

Transpose

extends_NoParamsGeometricTransform[Empty]
Transpose(p: float = 0.5)

Swap the H and W axes with probability p (Albumentations Transpose).

Exchanges the last two dimensions of the image and mask, and swaps (x, y) coordinates for bounding boxes and keypoints so every target sits in the new (W, H) canvas consistently.

Parameters

pfloat= 0.5
Probability of applying the transpose.

Examples

>>> import lucid, lucid.utils.transforms as T
>>> tf = T.Transpose(p=1.0)
>>> tuple(tf(T.Image(lucid.rand(3, 32, 32))).data.shape)
(3, 32, 32)

Used by 1

Constructors

1
dunder

__init__

→None
__init__(p: float = 0.5)

Instance methods

1
fn

make_params

→Emptyfrom _NoParams
make_params(img: Tensor)

Dunder methods

1