class_docstr: Base model for object detection with matching.
class_docstr_tok: ["Base","model","for","object","detection","with","matching","."]
docstr: Arrange loss dictionary into a metrics dictionary.
docstr_tok: ["Arrange","loss","dictionary","into","a","metrics","dictionary","."]
code: def get_metrics(self, metrics_dict: MetricsDict) -> MetricsDict:
      """Arrange loss dictionary into a metrics dictionary."""
      metrics = {}
      # Some metrics don't get scaled, so no need to keep their unscaled version,
      # i.e. those that are not in self.loss_terms_weights.keys()
      for k, v in metrics_dict.items():
          loss_term = self.loss_terms_weights.get(k)
          if loss_term is not None:
              metrics[f"{k}_unscaled"] = v
              metrics[k] = (loss_term * v[0], v[1])
          else:
              metrics[k] = v
  
      return 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 9 for calling the BaseModelWithMatching obj's underlying member method code with example usage: obj.get_metrics(metrics_dict) and returns: metrics