View source on GitHub |
Nearest neighbor upsampling implementation.
tfm.vision.spatial_transform_ops.nearest_upsampling(
data: tf.Tensor, scale: int, use_keras_layer: bool = False
) -> tf.Tensor
Args | |
---|---|
data
|
A tensor with a shape of [batch, height_in, width_in, channels]. |
scale
|
An integer multiple to scale resolution of input data. |
use_keras_layer
|
If True, use keras Upsampling2D layer. |
Returns | |
---|---|
data_up
|
A tensor with a shape of [batch, height_inscale, width_inscale, channels]. Same dtype as input data. |