class_docstr: Support the OVD models.
  Now support GroundingDINO: https://github.com/IDEA-Research/GroundingDINO
class_docstr_tok: ["Support","the","OVD","models",".","Now","support","GroundingDINO",":","https",":","\/\/github.com\/IDEA-Research\/GroundingDINO"]
docstr: Load the pretrained CLIP from huggingface transformers.
  
  Parameters
  ----------
  prefix
      The model prefix.
  num_classes
      The number of classes. 1 for a regression task.
  pretrained
      Whether using the pretrained weights. If pretrained=True, download the pretrained model.
docstr_tok: ["Load","the","pretrained","CLIP","from","huggingface","transformers",".","Parameters","--","--","--","--","--","prefix","The","model","prefix",".","num_classes","The","number","of","classes",".","1","for","a","regression","task",".","pretrained","Whether","using","the","pretrained","weights",".","If","pretrained=True",",","download","the","pretrained","model","."]
code: def __init__(
      self,
      prefix: str,
      checkpoint_name: str,
      pretrained: Optional[bool] = True,
  ):
      """
      Load the pretrained CLIP from huggingface transformers.
  
      Parameters
      ----------
      prefix
          The model prefix.
      num_classes
          The number of classes. 1 for a regression task.
      pretrained
          Whether using the pretrained weights. If pretrained=True, download the pretrained model.
      """
      super().__init__()
      logger.debug(f"initializing {checkpoint_name}")
      self.checkpoint_name = checkpoint_name
  
      self.config, self.model = self.get_ovd_config_and_model(
          checkpoint_name=checkpoint_name, pretrained=pretrained
      )
  
      self.box_threshold = self.config.box_threshold
      self.text_threshold = self.config.text_threshold
  
      self.prefix = prefix
  
      self.name_to_id = self.get_layer_ids()
      self.head_layer_names = [
          n for n, layer_id in self.name_to_id.items() if layer_id == 0
      ]
  
file_path: autogluon/multimodal/src/autogluon/multimodal/models/ovd.py
imports: import logging
  import os
  from typing import Optional
  import torch
  from torch import nn
  from ..constants import AUTOMM, BBOX, COLUMN, COLUMN_FEATURES, FEATURES, IMAGE, IMAGE_META, IMAGE_VALID_NUM, LABEL, LOGIT_SCALE, LOGITS, MASKS, PROMPT, TEXT_TOKEN_IDS, TEXT_VALID_LENGTH
  from .utils import assign_layer_ids, get_column_features, init_weights
label_desc: Use image node_id 1 to create a new OVDModel object from inherited base classes: nn with example: obj = OVDModel(prefix, checkpoint_name, pretrained)