@Operator(group="image") public final class ExtractGlimpse extends PrimitiveOp implements Operand<Float>
Returns a set of windows called glimpses extracted at location `offsets` from the input tensor. If the windows only partially overlaps the inputs, the non overlapping areas will be filled with random noise.
The result is a 4-D tensor of shape `[batch_size, glimpse_height, glimpse_width, channels]`. The channels and batch dimensions are the same as that of the input tensor. The height and width of the output windows are specified in the `size` parameter.
The argument `normalized` and `centered` controls how the windows are built:
Modifier and Type | Class and Description |
---|---|
static class |
ExtractGlimpse.Options
Optional attributes for
ExtractGlimpse |
operation
Modifier and Type | Method and Description |
---|---|
Output<Float> |
asOutput()
Returns the symbolic handle of a tensor.
|
static ExtractGlimpse.Options |
centered(Boolean centered) |
static ExtractGlimpse |
create(Scope scope,
Operand<Float> input,
Operand<Integer> size,
Operand<Float> offsets,
ExtractGlimpse.Options... options)
Factory method to create a class wrapping a new ExtractGlimpse operation.
|
Output<Float> |
glimpse()
A tensor representing the glimpses `[batch_size,
glimpse_height, glimpse_width, channels]`.
|
static ExtractGlimpse.Options |
noise(String noise) |
static ExtractGlimpse.Options |
normalized(Boolean normalized) |
static ExtractGlimpse.Options |
uniformNoise(Boolean uniformNoise) |
equals, hashCode, op, toString
public static ExtractGlimpse create(Scope scope, Operand<Float> input, Operand<Integer> size, Operand<Float> offsets, ExtractGlimpse.Options... options)
scope
- current scopeinput
- A 4-D float tensor of shape `[batch_size, height, width, channels]`.size
- A 1-D tensor of 2 elements containing the size of the glimpses
to extract. The glimpse height must be specified first, following
by the glimpse width.offsets
- A 2-D integer tensor of shape `[batch_size, 2]` containing
the y, x locations of the center of each window.options
- carries optional attributes valuespublic static ExtractGlimpse.Options centered(Boolean centered)
centered
- indicates if the offset coordinates are centered relative to
the image, in which case the (0, 0) offset is relative to the center
of the input images. If false, the (0,0) offset corresponds to the
upper left corner of the input images.public static ExtractGlimpse.Options normalized(Boolean normalized)
normalized
- indicates if the offset coordinates are normalized.public static ExtractGlimpse.Options uniformNoise(Boolean uniformNoise)
uniformNoise
- indicates if the noise should be generated using a
uniform distribution or a Gaussian distribution.public static ExtractGlimpse.Options noise(String noise)
noise
- indicates if the noise should `uniform`, `gaussian`, or
`zero`. The default is `uniform` which means the the noise type
will be decided by `uniform_noise`.public Output<Float> glimpse()
public Output<Float> asOutput()
Operand
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.
asOutput
in interface Operand<Float>
OperationBuilder.addInput(Output)
Copyright © 2022. All rights reserved.