class_docstr: Metric that calculates the mean IoU metric for each class.
  
  See more: https://en.wikipedia.org/wiki/Jaccard_index
  
  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.
class_docstr_tok: ["Metric","that","calculates","the","mean","IoU","metric","for","each","class",".","See","more",":","https",":","\/\/en.wikipedia.org\/wiki\/Jaccard_index","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","."]
code: def __init__(
      self,
      *args,
      threshold: float = 0.5,
      smooth=1e-3,
      average: str = "none",
      **kwargs,
  ):
      super().__init__(*args, **kwargs)
      self._evals = defaultdict(lambda: {"iou": 0, "count": 0})
      self.threshold = threshold
      self.smooth = smooth
      if average in ["none", "micro", "macro"]:
          self.average = average
      else:
          raise DeepchecksValueError(
              "average should be one of: none, micro, macro"
          )
  
file_path: deepchecks/deepchecks/vision/metrics_utils/semantic_segmentation_metrics.py
imports: from collections import defaultdict
  from typing import Tuple
  import numpy
  import torch
  from ignite.metrics import Metric
  from deepchecks.core.errors import DeepchecksValueError
  from deepchecks.vision.metrics_utils.semantic_segmentation_metric_utils import format_segmentation_masks, segmentation_counts_micro, segmentation_counts_per_class
label_desc: Use image node_id 1 to create a new MeanIoU object from inherited base classes: Metric with example: obj = MeanIoU()