class_docstr: Base model for object detection with matching.
class_docstr_tok: ["Base","model","for","object","detection","with","matching","."]
docstr: A convenience wrapper to all the loss_* functions in this class.
docstr_tok: ["A","convenience","wrapper","to","all","the","loss_","*","functions","in","this","class","."]
code: def get_losses_and_metrics(
      self,
      loss: str,
      outputs: ArrayDict,
      batch: ArrayDict,
      indices: jnp.ndarray,
      **kwargs: Any,
  ) -> Tuple[ArrayDict, MetricsDict]:
      """A convenience wrapper to all the loss_* functions in this class."""
      assert loss in self.loss_and_metrics_map, f"Unknown loss {loss}."
      return self.loss_and_metrics_map[loss](
          outputs, batch, indices, **kwargs
      )
  
imports: import abc
  import functools
  from typing import Any, Callable, Dict, Optional, Tuple
  import jax
  import jax.numpy
  import ml_collections
  from scenic.model_lib import matchers
  from scenic.model_lib.base_models import base_model
  from scenic.model_lib.base_models import box_utils
  from scenic.model_lib.base_models import model_utils
  from scenic.projects.owl_vit import losses
label_desc: Use image node_id 7 for calling the BaseModelWithMatching obj's underlying member method code with example usage: obj.get_losses_and_metrics(loss, outputs, batch, indices) and returns: self