RandomCrop

Stay organized with collections Save and categorize content based on your preferences.
public final class RandomCrop

Randomly crop `image`.

`size` is a 1-D int64 tensor with 2 elements representing the crop height and width. The values must be non negative.

This Op picks a random location in `image` and crops a `height` by `width` rectangle from that location. The random location is picked so the cropped area will fit inside the original image.

Nested Classes

class RandomCrop.Options Optional attributes for RandomCrop  

Constants

String OP_NAME The name of this op, as known by TensorFlow core engine

Public Methods

Output<T>
asOutput()
Returns the symbolic handle of the tensor.
static <T extends TNumber> RandomCrop<T>
create(Scope scope, Operand<T> image, Operand<TInt64> size, Options... options)
Factory method to create a class wrapping a new RandomCrop operation.
Output<T>
output()
3-D of shape `[crop_height, crop_width, channels].`
static RandomCrop.Options
seed(Long seed)
static RandomCrop.Options
seed2(Long seed2)

Inherited Methods

Constants

public static final String OP_NAME

The name of this op, as known by TensorFlow core engine

Constant Value: "RandomCrop"

Public Methods

public Output<T> asOutput ()

Returns the symbolic handle of the tensor.

Inputs to TensorFlow operations are outputs of another TensorFlow operation. This method is used to obtain a symbolic handle that represents the computation of the input.

public static RandomCrop<T> create (Scope scope, Operand<T> image, Operand<TInt64> size, Options... options)

Factory method to create a class wrapping a new RandomCrop operation.

Parameters
scope current scope
image 3-D of shape `[height, width, channels]`.
size 1-D of length 2 containing: `crop_height`, `crop_width`..
options carries optional attributes values
Returns
  • a new instance of RandomCrop

public Output<T> output ()

3-D of shape `[crop_height, crop_width, channels].`

public static RandomCrop.Options seed (Long seed)

Parameters
seed If either seed or seed2 are set to be non-zero, the random number generator is seeded by the given seed. Otherwise, it is seeded by a random seed.

public static RandomCrop.Options seed2 (Long seed2)

Parameters
seed2 An second seed to avoid seed collision.