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 __init__(
      self,
      model: Module,
      train_dataloader: DataLoader[Any],
      valid_dataloader: DataLoader[Any],
      criterion: Optional[Module],
      optimizer: Optimizer,
      scheduler: lr_scheduler._LRScheduler,
      config: Configuration,
      num_classes: int,
      callbacks: Optional[Dict[str, Callable[..., None]]] = None,
      loss_computed_by_model: Optional[bool] = None,
  ) -> None:
      if callbacks is None:
          callbacks = {}
      super().__init__(
          model,
          train_dataloader,
          valid_dataloader,
          criterion,
          optimizer,
          scheduler,
          config,
          callbacks,
      )
      # TODO: auto-detect if the model is from TorchVision
      self.loss_computed_by_model = loss_computed_by_model
      self.num_classes = num_classes
  
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 1 to create a new ObjectDetectionTrainer object from inherited base classes: Trainer with example: obj = ObjectDetectionTrainer(model, train_dataloader, valid_dataloader, criterion, optimizer, scheduler, config, num_classes, callbacks, loss_computed_by_model)