class_docstr: Base model for object detection with matching.
class_docstr_tok: ["Base","model","for","object","detection","with","matching","."]
docstr: Initialize model.
  
  Args:
    config: Configurations of the model.
    dataset_meta_data: Dataset meta data specifies `target_is_onehot`, which
      must be True. The padding-objects have label 0. The first legitimate
      object has label 1, and so on.
docstr_tok: ["Initialize","model",".","Args",":","config",":","Configurations","of","the","model",".","dataset_meta_data",":","Dataset","meta","data","specifies","`","target_is_onehot","`",",","which","must","be","True",".","The","padding-objects","have","label","0",".","The","first","legitimate","object","has","label","1",",","and","so","on","."]
code: def __init__(
      self,
      config: Optional[ml_collections.ConfigDict],
      dataset_meta_data: Dict[str, Any],
  ):
      """Initialize model.
  
      Args:
        config: Configurations of the model.
        dataset_meta_data: Dataset meta data specifies `target_is_onehot`, which
          must be True. The padding-objects have label 0. The first legitimate
          object has label 1, and so on.
      """
      if not dataset_meta_data.get("target_is_onehot", True):
          raise ValueError(
              "Targets must be in one-hot/multi-hot format."
          )
      self.losses_and_metrics = ["labels"]
      if config is not None:
          self.loss_terms_weights = {
              "loss_class": config.class_loss_coef
          }
      super().__init__(config, dataset_meta_data)
  
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 1 to create a new BaseModelWithMatching object from inherited base classes: base_model with example: obj = BaseModelWithMatching(config, dataset_meta_data)