class_docstr: Text-query-based OWL-ViT model.
  
  This module computes joint text and image embeddings which are then
  used for localized prediction of bounding boxes and classes.
  
  Attributes:
    body_configs: Configurations of the image-text module.
    objectness_head_configs: Configurations for the (optional) objectness head.
    mask_head_configs: Configurations for the (optional) mask head.
    normalize: Whether to normalize the output of the model and the
      label_embeddings before computing the class logits.
    box_bias: Type of box bias - one of 'location', 'size' or 'both'.
class_docstr_tok: ["Text-query-based","OWL-ViT","model",".","This","module","computes","joint","text","and","image","embeddings","which","are","then","used","for","localized","prediction","of","bounding","boxes","and","classes",".","Attributes",":","body_configs",":","Configurations","of","the","image-text","module",".","objectness_head_configs",":","Configurations","for","the","(","optional",")","objectness","head",".","mask_head_configs",":","Configurations","for","the","(","optional",")","mask","head",".","normalize",":","Whether","to","normalize","the","output","of","the","model","and","the","label_embeddings","before","computing","the","class","logits",".","box_bias",":","Type","of","box","bias","-","one","of","'location","'",",","'size","'","or","'both","'","."]
docstr: Loads backbone parameters for this model from a backbone checkpoint.
docstr_tok: ["Loads","backbone","parameters","for","this","model","from","a","backbone","checkpoint","."]
code: def load(
      self, params: Params, init_config: ml_collections.ConfigDict
  ) -> Params:
      """Loads backbone parameters for this model from a backbone checkpoint."""
      if init_config.get("codebase") == "clip":
          # Initialize backbone parameters from an external codebase.
          params["backbone"] = self._embedder.load_backbone(
              params["backbone"], init_config.get("checkpoint_path")
          )
      else:
          # Initialize all parameters from a Scenic checkpoint.
          restored_train_state = checkpoints.restore_checkpoint(
              init_config.checkpoint_path, target=None
          )
          if "optimizer" in restored_train_state:
              # Pre-Optax checkpoint:
              params = restored_train_state["optimizer"]["target"]
          else:
              params = restored_train_state["params"]
  
          # Explicitly removing unused parameters after loading:
          params["class_head"].pop("padding", None)
          params["class_head"].pop("padding_bias", None)
  
      params = _fix_old_checkpoints(params)
  
      return params
  
imports: import copy
  from typing import Any, Dict, List, Mapping, Optional
  import flax.linen
  from flax.training import checkpoints
  import jax
  import jax.numpy
  import ml_collections
  from scenic.projects.owl_vit import layers
  from scenic.projects.owl_vit import matching_base_models
  from scenic.projects.owl_vit import utils
  from scenic.projects.owl_vit.clip import model
  from scenic.projects.owl_vit.clip import tokenizer
label_desc: Use image node_id 11 for calling the TextZeroShotDetectionModule obj's underlying member method code with example usage: obj.load(params, init_config) and returns: params