class_docstr: Base model for object detection with matching including a mask loss.
  
  The masks are predicted one for each instance and must be in direct
  correspondence with the bounding boxes (both predicted and ground truth).
  
  In practice this is typically used to predict cropped masks within the
  predicted bounding boxes, similar to what has been done with, for example,
  mask RCNN. Right now the cropping must occur outside this class.
class_docstr_tok: ["Base","model","for","object","detection","with","matching","including","a","mask","loss",".","The","masks","are","predicted","one","for","each","instance","and","must","be","in","direct","correspondence","with","the","bounding","boxes","(","both","predicted","and","ground","truth",")",".","In","practice","this","is","typically","used","to","predict","cropped","masks","within","the","predicted","bounding","boxes",",","similar","to","what","has","been","done","with",",","for","example",",","mask","RCNN",".","Right","now","the","cropping","must","occur","outside","this","class","."]
docstr: Returns a dict that lists all losses for this model.
docstr_tok: ["Returns","a","dict","that","lists","all","losses","for","this","model","."]
code: def loss_and_metrics_map(
      self,
  ) -> Dict[str, Callable[..., Tuple[ArrayDict, MetricsDict]]]:
      """Returns a dict that lists all losses for this model."""
      return {
          **super().loss_and_metrics_map,
          "boxes": self.boxes_losses_and_metrics,
          "masks": self.masks_losses_and_metrics,
      }
  
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 2 for calling the ObjectDetectionModelWithMasks obj's underlying member method code with example usage: obj.loss_and_metrics_map() and returns: dict