Random element of the dihedral group D4 (Albumentations D4).
The 8 symmetries of a square = rot90^k (k∈0..3) optionally
followed by a horizontal flip.
Parameters
pfloat= 1.0Probability of applying the transform; otherwise the input
passes through unchanged.
Examples
>>> import lucid, lucid.utils.transforms as T
>>> tf = T.D4(p=1.0)
>>> tuple(tf(T.Image(lucid.rand(3, 32, 32))).data.shape)
(3, 32, 32)Used by 1
Constructors
1Instance methods
1Sample per-call random parameters for D4.
Parameters
imgTensorImage tensor; not inspected, carried through for dispatch.
Returns
D4ParamCarries k (rot90 count, 0..3) and flip (whether
to follow with a horizontal flip). The two together
uniformly cover the 8 elements of the square-symmetry
group D4.