kd.data.py.Resize

kd.data.py.Resize#

class kauldron.data.py.Resize(*, key: typing.Annotated[typing.Any, <object object at 0x7824c478ba80>] | typing.Sequence[typing.Annotated[typing.Any, <object object at 0x7824c478ba80>]] | dict[typing.Annotated[typing.Any, <object object at 0x7824c478ba80>], typing.Annotated[typing.Any, <object object at 0x7824c478ba80>]], size: tuple[int, int], method: str | jax._src.image.scale.ResizeMethod | tensorflow.python.ops.image_ops_impl.ResizeMethod | None = None, antialias: bool = True)[source]

Bases: kauldron.data.transforms.base.ElementWiseTransform

Resizes an image.

size

The new size of the image.

Type:

tuple[int, int]

method

The resizing method. If None, uses area for float inputs and nearest for int inputs, and area for float inputs.

Type:

str | jax._src.image.scale.ResizeMethod | tensorflow.python.ops.image_ops_impl.ResizeMethod | None

antialias

Whether to use an anti-aliasing filter.

Type:

bool

size: tuple[int, int]
method: str | jax._src.image.scale.ResizeMethod | tensorflow.python.ops.image_ops_impl.ResizeMethod | None = None
antialias: bool = True
map_element(
element: jaxtyping.Shaped[Tensor, '*b h w c'] | jaxtyping.Shaped[ndarray, '*b h w c'] | jaxtyping.Shaped[Array, '*b h w c'],
) jaxtyping.Shaped[Tensor, '*b h2 w2 c'] | jaxtyping.Shaped[ndarray, '*b h2 w2 c'] | jaxtyping.Shaped[Array, '*b h2 w2 c'][source]
key: kontext.Key | Sequence[kontext.Key] | dict[kontext.Key, kontext.Key]