# nvidia.dali.fn.transforms.crop¶

nvidia.dali.fn.transforms.crop(*inputs, **kwargs)

Produces an affine transform matrix that maps a reference coordinate space to another one.

This transform can be used to adjust coordinates after a crop operation so that a from_start point will be mapped to to_start and from_end will be mapped to to_end.

If another transform matrix is passed as an input, the operator applies the transformation to the matrix provided.

Note

The output of this operator can be fed directly to CoordTransform and WarpAffine operators.

This operator allows sequence inputs.

Supported backends
• ‘cpu’

Parameters

input (TensorList, optional) – Input to the operator.

Keyword Arguments
• absolute (bool, optional, default = False) – If set to true, start and end coordinates will be swapped if start > end.

• 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.

• from_end (float or list of float or TensorList of float, optional, default = [1.0]) –

The upper bound of the original coordinate space.

Note

If left empty, a vector of ones will be assumed. If a single value is provided, it will be repeated to match the number of dimensions

Supports per-frame inputs.

• from_start (float or list of float or TensorList of float, optional, default = [0.0]) –

The lower bound of the original coordinate space.

Note

If left empty, a vector of zeros will be assumed. If a single value is provided, it will be repeated to match the number of dimensions

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.

• to_end (float or list of float or TensorList of float, optional, default = [1.0]) –

The upper bound of the destination coordinate space.

Note

If left empty, a vector of ones will be assumed. If a single value is provided, it will be repeated to match the number of dimensions

Supports per-frame inputs.

• to_start (float or list of float or TensorList of float, optional, default = [0.0]) –

The lower bound of the destination coordinate space.

Note

If left empty, a vector of zeros will be assumed. If a single value is provided, it will be repeated to match the number of dimensions

Supports per-frame inputs.