kd.summaries.ShowImages

kd.summaries.ShowImages#

class kauldron.summaries.ShowImages(*, images: typing.Annotated[typing.Any, <object object at 0x7824c478ba80>], num_images: int = 5, in_vrange: tuple[float, float] | None = None, rearrange: str | None = None, rearrange_kwargs: typing.Mapping[str, typing.Any] | None = None)[source]

Bases: kauldron.metrics.base.Metric

Show image summaries with optional reshaping.

images

Key to the images to display.

Type:

Any

num_images

Number of images to collect and display. Default 5.

Type:

int

vrange

Optional value range of the input images. Used to clip aand then rescale the images to [0, 1].

rearrange

Optional einops string to reshape the images.

Type:

str | None

rearrange_kwargs

Optional keyword arguments for the einops reshape.

Type:

Mapping[str, Any] | None

images: Annotated[Any, <object object at 0x7824c478ba80>]
num_images: int = 5
in_vrange: tuple[float, float] | None = None
rearrange: str | None = None
rearrange_kwargs: Mapping[str, Any] | None = None
class State(
images: Float['n h w #3'] | UInt8['n h w #3'],
*,
parent: _MetricT = _EMPTY_TYPE.EMPTY,
)[source]

Bases: kauldron.metrics.auto_state.AutoState[ShowImages]

Collects the first num_images images.

images: Float['n h w #3'] | UInt8['n h w #3']
compute() jaxtyping.Float[Array, 'n h w #3'] | jaxtyping.Float[ndarray, 'n h w #3'][source]

Computes final metrics from intermediate values.

merge(
other: kauldron.metrics.auto_state._SelfT,
) kauldron.metrics.auto_state._SelfT[source]

Checks static fields for equality and merges data-fields.

replace(**updates)

Returns a new object replacing the specified fields with new values.

get_state(
images: jaxtyping.Float[Array, '...'] | jaxtyping.Float[ndarray, '...'] | jaxtyping.UInt8[Array, '...'] | jaxtyping.UInt8[ndarray, '...'],
) kauldron.summaries.images.ShowImages.State[source]
empty() kauldron.metrics.base.Metric.State[source]