kd.metrics.Ssim

kd.metrics.Ssim#

class kauldron.metrics.Ssim(
*,
pred: typing.Annotated[typing.Any,
<object object at 0x7824c478ba80>] = '__KEY_REQUIRED__',
target: typing.Annotated[typing.Any,
<object object at 0x7824c478ba80>] = '__KEY_REQUIRED__',
mask: typing.Annotated[typing.Any,
<object object at 0x7824c478ba80>] | None = None,
in_vrange: tuple[float,
float] = (0.0,
1.0),
filter_size: int = 11,
filter_sigma: float = 1.5,
k1: float = 0.01,
k2: float = 0.03,
)[source]

Bases: kauldron.metrics.base.Metric

Structural similarity (SSIM).

pred: Annotated[Any, <object object at 0x7824c478ba80>] = '__KEY_REQUIRED__'
target: Annotated[Any, <object object at 0x7824c478ba80>] = '__KEY_REQUIRED__'
mask: Annotated[Any, <object object at 0x7824c478ba80>] | None = None
in_vrange: tuple[float, float] = (0.0, 1.0)
filter_size: int = 11
filter_sigma: float = 1.5
k1: float = 0.01
k2: float = 0.03
class State(
total: "Float['']",
count: "Float['']",
*,
parent: '_MetricT' = <_EMPTY_TYPE.EMPTY: 1>,
)[source]

Bases: kauldron.metrics.base_state.AverageState

merge(
other: kauldron.metrics.base_state.AverageState,
) kauldron.metrics.base_state.AverageState[source]

Returns a new state that is the accumulation of self and other.

Parameters:

other – A State whose intermediate values should be accumulated onto the values of self.

Returns:

A new State that accumulates the value from both self and other.

replace(**updates)

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

get_state(
pred: jaxtyping.Float[Array, '*b h w c'] | jaxtyping.Float[ndarray, '*b h w c'],
target: jaxtyping.Float[Array, '*b h w c'] | jaxtyping.Float[ndarray, '*b h w c'],
mask: jaxtyping.Bool[Array, '*b 1'] | jaxtyping.Bool[ndarray, '*b 1'] | jaxtyping.Float[Array, '*b 1'] | jaxtyping.Float[ndarray, '*b 1'] | None = None,
) kauldron.metrics.image.Ssim.State[source]
empty() kauldron.metrics.base.Metric.State[source]