RandomResizedCrop

cvcuda.random_resized_crop(src: nvcv.Tensor, shape: Tuple, min_scale: double, max_scale: double, min_ratio: double, max_ratio: double, interp: Interp = cvcuda.Interp.LINEAR, seed: int, stream: Optional[nvcv.cuda.Stream] = None) nvcv.Tensor

Executes the RandomResizedCrop operation on the given cuda stream.

See also

Refer to the CV-CUDA C API reference for the RandomResizedCrop operator for more details and usage examples.

Parameters:
  • src (nvcv.Tensor) – Input tensor containing one or more images.

  • shape (Tuple) – Shape of output tensor.

  • min_scale (double, optional) – Lower bound for the random area of the crop, before resizing. The scale is defined with respect to the area of the original image.

  • max_scale (double, optional) – Upper bound for the random area of the crop, before resizing. The scale is defined with respect to the area of the original image.

  • min_ratio (double, optional) – Lower bound for the random aspect ratio of the crop, before resizing.

  • max_ratio (double, optional) – Upper bound for the random aspect ratio of the crop, before resizing.

  • interp (cvcuda.Interp, optional) – Interpolation type used for transform.

  • seed (int, optional) – Random seed, should be unsigned int32.

  • stream (nvcv.cuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor.

Return type:

nvcv.Tensor

Caution

Restrictions to several arguments may apply. Check the C API references of the CV-CUDA operator.

cvcuda.random_resized_crop(src: nvcv.ImageBatchVarShape, shape: Tuple, min_scale: double, max_scale: double, min_ratio: double, max_ratio: double, interp: Interp = cvcuda.Interp.LINEAR, seed: int, stream: Optional[nvcv.cuda.Stream] = None) -> nvcv.ImageBatchVarShape

Executes the RandomResizedCrop operation on the given cuda stream.

See also

Refer to the CV-CUDA C API reference for the RandomResizedCrop operator for more details and usage examples.

Parameters:
  • src (nvcv.ImageBatchVarShape) – Input image batch containing one or more images.

  • sizes (Tuple vector) – Shapes of output images.

  • min_scale (double, optional) – Lower bound for the random area of the crop, before resizing. The scale is defined with respect to the area of the original image.

  • max_scale (double, optional) – Upper bound for the random area of the crop, before resizing. The scale is defined with respect to the area of the original image.

  • min_ratio (double, optional) – Lower bound for the random aspect ratio of the crop, before resizing.

  • max_ratio (double, optional) – Upper bound for the random aspect ratio of the crop, before resizing.

  • interp (cvcuda.Interp, optional) – Interpolation type used for transform.

  • seed (int, optional) – Random seed, should be unsigned int32.

  • stream (nvcv.cuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor.

Return type:

nvcv.Tensor

Caution

Restrictions to several arguments may apply. Check the C API references of the CV-CUDA operator.

cvcuda.random_resized_crop_into(dst: nvcv.Tensor, src: nvcv.Tensor, shape: Tuple, min_scale: double, max_scale: double, min_ratio: double, max_ratio: double, interp: Interp = cvcuda.Interp.LINEAR, seed: int, stream: Optional[nvcv.cuda.Stream] = None)

Executes the RandomResizedCrop operation on the given cuda stream.

See also

Refer to the CV-CUDA C API reference for the RandomResizedCrop operator for more details and usage examples.

Parameters:
  • dst (nvcv.Tensor) – Output tensor to store the result of the operation.

  • src (nvcv.Tensor) – Input tensor containing one or more images.

  • min_scale (double, optional) – Lower bound for the random area of the crop, before resizing. The scale is defined with respect to the area of the original image.

  • max_scale (double, optional) – Upper bound for the random area of the crop, before resizing. The scale is defined with respect to the area of the original image.

  • min_ratio (double, optional) – Lower bound for the random aspect ratio of the crop, before resizing.

  • max_ratio (double, optional) – Upper bound for the random aspect ratio of the crop, before resizing.

  • interp (cvcuda.Interp, optional) – Interpolation type used for transform.

  • seed (int, optional) – Random seed, should be unsigned int32.

  • stream (nvcv.cuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

None

Caution

Restrictions to several arguments may apply. Check the C API references of the CV-CUDA operator.

cvcuda.random_resized_crop_into(dst: nvcv.ImageBatchVarShape, src: nvcv.ImageBatchVarShape, shape: Tuple, min_scale: double, max_scale: double, min_ratio: double, max_ratio: double, interp: Interp = cvcuda.Interp.LINEAR, seed: int, stream: Optional[nvcv.cuda.Stream] = None)

Executes the RandomResizedCrop operation on the given cuda stream.

See also

Refer to the CV-CUDA C API reference for the RandomResizedCrop operator for more details and usage examples.

Parameters:
  • src (nvcv.ImageBatchVarShape) – Input image batch containing one or more images.

  • dst (nvcv.ImageBatchVarShape) – Output image batch containing the result of the operation.

  • min_scale (double, optional) – Lower bound for the random area of the crop, before resizing. The scale is defined with respect to the area of the original image.

  • max_scale (double, optional) – Upper bound for the random area of the crop, before resizing. The scale is defined with respect to the area of the original image.

  • min_ratio (double, optional) – Lower bound for the random aspect ratio of the crop, before resizing.

  • max_ratio (double, optional) – Upper bound for the random aspect ratio of the crop, before resizing.

  • interp (cvcuda.Interp, optional) – Interpolation type used for transform.

  • seed (int, optional) – Random seed, should be unsigned int32.

  • stream (nvcv.cuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

None

Caution

Restrictions to several arguments may apply. Check the C API references of the CV-CUDA operator.