nvidia.dali.fn.peek_image_shape#

nvidia.dali.fn.peek_image_shape(input, /, *, device=None, name=None, bytes_per_sample_hint=[0], dtype=DALIDataType.INT64, preserve=False)#

Obtains the shape of the encoded image.

This operator returns the shape that an image would have after decoding.

Note

In most cases the optimal solution is to call nvidia.dali.pipeline.DataNode.shape() on the decoded images. Use this operator if you either do not intend to decode the image in your pipeline, or do not use the default execution model (i.e., explicitly set exec_dynamic=False).

Supported backends
  • ‘cpu’

Parameters:

input (TensorList) – Input to the operator.

Keyword Arguments:
  • 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.

  • dtype (nvidia.dali.types.DALIDataType, optional, default = DALIDataType.INT64) – Data type, to which the sizes are converted.

  • preserve (bool, optional, default = False) – Prevents the operator from being removed from the graph even if its outputs are not used.

  • type (nvidia.dali.types.DALIDataType) –

    Warning

    The argument type is a deprecated alias for dtype. Use dtype instead.