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: Predicts the probability that each image feature token is an object.
  
  Args:
    image_features: Features extracted from the image.
    train: Whether or not we are in training mode.
  
  Returns:
    Objectness scores, in a dictionary.
docstr_tok: ["Predicts","the","probability","that","each","image","feature","token","is","an","object",".","Args",":","image_features",":","Features","extracted","from","the","image",".","train",":","Whether","or","not","we","are","in","training","mode",".","Returns",":","Objectness","scores",",","in","a","dictionary","."]
code: def objectness_predictor(
      self, image_features: jnp.ndarray, train: bool = False
  ) -> Dict[str, jnp.ndarray]:
      """Predicts the probability that each image feature token is an object.
  
      Args:
        image_features: Features extracted from the image.
        train: Whether or not we are in training mode.
  
      Returns:
        Objectness scores, in a dictionary.
      """
      del train
      if self.objectness_head_configs is None:
          raise ValueError(
              "Must pass objectness_configs to use objectness head."
          )
      if self.objectness_head_configs.stop_gradient:
          image_features = jax.lax.stop_gradient(image_features)
      objectness_logits = self._objectness_head(image_features)
      return {"objectness_logits": objectness_logits[..., 0]}
  
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 4 for calling the TextZeroShotDetectionModule obj's underlying member method code with example usage: obj.objectness_predictor(image_features, train) and returns: dict