random_crop

ivy.random_crop(x, crop_size, batch_shape=None, image_dims=None, f=None)[source]

Randomly crops the input images.

Parameters
  • x (array) – Input images to crop [batch_shape,h,w,f]

  • crop_size (sequence of ints) – The 2D crop size.

  • batch_shape (sequence of ints, optional) – Shape of batch. Inferred from inputs if None.

  • image_dims (sequence of ints, optional) – Image dimensions. Inferred from inputs in None.

  • f (ml_framework, optional) – Machine learning library. Inferred from inputs if None.

Returns

The new cropped image [batch_shape,nh,nw,f]


Supported Frameworks:

empty jax_logo empty tf_logo empty pytorch_logo empty mxnet_logo empty numpy_logo empty