Warning: This project is deprecated. TensorFlow Addons has stopped development,
The project will only be providing minimal maintenance releases until May 2024. See the full
announcement here or on
github.
tfa.image.resampler
Stay organized with collections
Save and categorize content based on your preferences.
Resamples input data at user defined coordinates.
@tf.function
tfa.image.resampler(
data: tfa.types.TensorLike
,
warp: tfa.types.TensorLike
,
name: Optional[str] = None
) -> tf.Tensor
The resampler currently only supports bilinear interpolation of 2D data.
Args |
data
|
Tensor of shape [batch_size, data_height, data_width,
data_num_channels] containing 2D data that will be resampled.
|
warp
|
Tensor of minimum rank 2 containing the coordinates at
which resampling will be performed. Since only bilinear
interpolation is currently supported, the last dimension of the
warp tensor must be 2, representing the (x, y) coordinate where
x is the index for width and y is the index for height.
|
name
|
Optional name of the op.
|
Returns |
Tensor of resampled values from data . The output tensor shape
is determined by the shape of the warp tensor. For example, if data
is of shape [batch_size, data_height, data_width, data_num_channels]
and warp of shape [batch_size, dim_0, ... , dim_n, 2] the output will
be of shape [batch_size, dim_0, ... , dim_n, data_num_channels] .
|
Raises |
ImportError
|
if the wrapper generated during compilation is not
present when the function is called.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-05-25 UTC.
[null,null,["Last updated 2023-05-25 UTC."],[],[],null,["# tfa.image.resampler\n\n\u003cbr /\u003e\n\n|-----------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/addons/blob/v0.20.0/tensorflow_addons/image/resampler_ops.py#L27-L57) |\n\nResamples input data at user defined coordinates. \n\n @tf.function\n tfa.image.resampler(\n data: ../../tfa/types/TensorLike,\n warp: ../../tfa/types/TensorLike,\n name: Optional[str] = None\n ) -\u003e tf.Tensor\n\nThe resampler currently only supports bilinear interpolation of 2D data.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|--------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `data` | `Tensor` of shape `[batch_size, data_height, data_width, data_num_channels]` containing 2D data that will be resampled. |\n| `warp` | Tensor of minimum rank 2 containing the coordinates at which resampling will be performed. Since only bilinear interpolation is currently supported, the last dimension of the `warp` tensor must be 2, representing the `(x, y)` coordinate where `x` is the index for width and `y` is the index for height. |\n| `name` | Optional name of the op. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| Tensor of resampled values from `data`. The output tensor shape is determined by the shape of the warp tensor. For example, if `data` is of shape `[batch_size, data_height, data_width, data_num_channels]` and warp of shape `[batch_size, dim_0, ... , dim_n, 2]` the output will be of shape `[batch_size, dim_0, ... , dim_n, data_num_channels]`. ||\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Raises ------ ||\n|---------------|-----------------------------------------------------------------------------------------|\n| `ImportError` | if the wrapper generated during compilation is not present when the function is called. |\n\n\u003cbr /\u003e"]]