MeanDice#

class MeanDice[source]#

Metric that calculates the mean Dice metric for each class.

See more: https://en.wikipedia.org/wiki/S%C3%B8rensen%E2%80%93Dice_coefficient

Parameters
threshold: float, default: 0.5

prediction value per pixel above which the pixel is considered True.

smooth: float, default: 1e-3

smoothing factor to prevent division by zero when the mask is empty.

average: str, default: none

The method for averaging over the classes. If none, returns the result per class.

__init__(*args, threshold: float = 0.5, smooth=0.001, average: str = 'none', **kwargs)[source]#
__new__(*args, **kwargs)#

Attributes

MeanDice.required_output_keys

Methods

MeanDice.attach(engine, name[, usage])

Attaches current metric to provided engine.

MeanDice.completed(engine, name)

Helper method to compute metric's value and put into the engine.

MeanDice.compute()

Compute metric value.

MeanDice.detach(engine[, usage])

Detaches current metric from the engine and no metric's computation is done during the run.

MeanDice.is_attached(engine[, usage])

Checks if current metric is attached to provided engine.

MeanDice.iteration_completed(engine)

Helper method to update metric's computation.

MeanDice.load_state_dict(state_dict)

Method replaces internal state of the class with provided state dict data.

MeanDice.reset()

Reset metric state.

MeanDice.started(engine)

Helper method to start data gathering for metric's computation.

MeanDice.state_dict()

Method returns state dict with attributes of the metric specified in its _state_dict_all_req_keys attribute.

MeanDice.update(output)

Update metric with batch of samples.