nvidia.dali.fn.transforms.shear¶
-
nvidia.dali.fn.transforms.
shear
(*inputs, **kwargs)¶ Produces a shear affine transform matrix.
If another transform matrix is passed as an input, the operator applies the shear mapping to the matrix provided.
Note
The output of this operator can be fed directly to
CoordTransform
andWarpAffine
operators.This operator allows sequence inputs.
- Supported backends
‘cpu’
- Parameters
input (TensorList, optional) – Input to the operator.
- Keyword Arguments
angles (float or list of float or TensorList of float, optional) –
The shear angles, in degrees.
This argument is mutually exclusive with
shear
.For 2D,
angles
contains two elements: angle_x, angle_y.For 3D,
angles
contains six elements: angle_xy, angle_xz, angle_yx, angle_yz, angle_zx, angle_zy.A shear angle is translated to a shear factor as follows:
shear_factor = tan(deg2rad(shear_angle))
Note
The valid range of values is between -90 and 90 degrees. This argument is mutually exclusive with
shear
. If provided, the number of dimensions of the transform is inferred from this argument.Supports
per-frame
inputs.bytes_per_sample_hint (int or list of int, optional, default = [0]) –
Output size hint, in bytes per sample.
If specified, the operator’s outputs residing in GPU or page-locked host memory will be preallocated to accommodate a batch of samples of this size.
center (float or list of float or TensorList of float, optional) –
The center of the shear operation.
If provided, the number of elements should match the dimensionality of the transform.
Supports
per-frame
inputs.preserve (bool, optional, default = False) – Prevents the operator from being removed from the graph even if its outputs are not used.
reverse_order (bool, optional, default = False) –
Determines the order when combining affine transforms.
If set to False (default), the operator’s affine transform will be applied to the input transform. If set to True, the input transform will be applied to the operator’s transform.
If there’s no input, this argument is ignored.
seed (int, optional, default = -1) –
Random seed.
If not provided, it will be populated based on the global seed of the pipeline.
shear (float or list of float or TensorList of float, optional) –
The shear factors.
For 2D,
shear
contains two elements: shear_x, shear_y.For 3D,
shear
contains six elements: shear_xy, shear_xz, shear_yx, shear_yz, shear_zx, shear_zy.A shear factor value can be interpreted as the offset to be applied in the first axis when moving in the direction of the second axis.
Note
This argument is mutually exclusive with
angles
. If provided, the number of dimensions of the transform is inferred from this argument.Supports
per-frame
inputs.