metrics package

Submodules

metrics.divahisdb module

class HisDBIoU(num_classes: Optional[int] = None, mask_modifies_prediction: bool = True, compute_on_step: bool = True, dist_sync_on_step: bool = False, process_group: Optional[Any] = None, dist_sync_fn: Optional[Callable] = None)[source]

Bases: Metric

Implementation of the mIoU metric used in the paper of Alberti et al.. Using it just makes sense if the gt is in the DIVA-HisDB format.

Parameters:
  • num_classes (int) – number of classes

  • mask_modifies_prediction (bool) – if True, the mask is used to modify the prediction, otherwise the prediction is used to modify the mask

  • compute_on_step (bool) – Forward only calls update() and return None if this is set to False. default: True

  • dist_sync_on_step (bool) – Synchronize metric state across processes at each forward() before returning the value at the step. default: False

  • process_group (Optional[Any]) – Specify the process group on which synchronization is called. default: None (which selects the entire world)

compute() Any[source]

Override this method to compute the final metric value from state variables synchronized across the distributed backend.

update(pred: Tensor, target: Tensor, mask: Optional[Tensor] = None, **kwargs) None[source]

Override this method to update the state variables of your metric class.

Module contents