class_docstr: Module to be used for object detection purposes.
  
  The module subclasses :py:class:`~kornia.x.Trainer` and overrides the
  :py:func:`~kornia.x.Trainer.evaluate` function implementing IoU :py:func:`~kornia.metrics.mean_iou`.
  
  .. seealso::
      Learn how to use this class in the following
      `example <https://github.com/kornia/tutorials/tree/master/scripts/training/object_detection/>`__.
class_docstr_tok: ["Module","to","be","used","for","object","detection","purposes",".","The","module","subclasses",":","py",":","class",":","`","~kornia.x.Trainer","`","and","overrides","the",":","py",":","func",":","`","~kornia.x.Trainer.evaluate","`","function","implementing","IoU",":","py",":","func",":","`","~kornia.metrics.mean_iou","`",".","..","seealso",":",":","Learn","how","to","use","this","class","in","the","following","`","example","<","https",":","\/\/github.com\/kornia\/tutorials\/tree\/master\/scripts\/training\/object_detection\/",">","`","__","."]
code: def compute_metrics(
      self, *args: Tuple[Dict[str, Tensor]]
  ) -> Dict[str, float]:
      if (
          isinstance(args[0], dict)
          and "boxes" in args[0]
          and "labels" in args[0]
          and "scores" in args[0]
          and isinstance(args[1], dict)
          and "boxes" in args[1]
          and "labels" in args[1]
      ):
          mAP, _ = mean_average_precision(
              [a["boxes"] for a in args[0]],
              [a["labels"] for a in args[0]],
              [a["scores"] for a in args[0]],
              [a["boxes"] for a in args[1]],
              [a["labels"] for a in args[1]],
              n_classes=self.num_classes,
              threshold=0.000001,
          )
          return {"mAP": mAP.item()}
      return super().compute_metrics(*args)
  
file_path: kornia/kornia/x/trainers.py
imports: from typing import Any, Callable, Dict, Optional, Tuple
  from torch.optim import Optimizer, lr_scheduler
  from torch.utils.data import DataLoader
  from kornia.core import Module, Tensor, stack
  from kornia.metrics import accuracy, mean_average_precision, mean_iou
  from .trainer import Trainer
  from .utils import Configuration
label_desc: Use image node_id 4 for calling the ObjectDetectionTrainer obj's underlying member method code with example usage: obj.compute_metrics() and returns: super, dict