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"]
code: def get_ovd_config_and_model(
      self,
      checkpoint_name: str,
      pretrained: bool = True,
  ):
      from ..utils import download, get_pretrain_configs_dir
  
      ovd_configs_dir = get_pretrain_configs_dir(subfolder="ovd")
      OVD_CUSTOM_MODELS = {
          "GroundingDINO_SwinB": {
              "url": "https://github.com/IDEA-Research/GroundingDINO/releases/download/v0.1.0-alpha2/groundingdino_swinb_cogcoor.pth",
              "config_file": os.path.join(
                  ovd_configs_dir,
                  "grounding_dino",
                  "GroundingDINO_SwinB.cfg.py",
              ),
          },
          "GroundingDINO_SwinT_OGC": {
              "url": "https://github.com/IDEA-Research/GroundingDINO/releases/download/v0.1.0-alpha/groundingdino_swint_ogc.pth",
              "config_file": os.path.join(
                  ovd_configs_dir,
                  "grounding_dino",
                  "GroundingDINO_SwinT_OGC.py",
              ),
          },
      }
  
      if checkpoint_name in [
          "GroundingDINO_SwinB",
          "GroundingDINO_SwinT_OGC",
      ]:
          try:
              from groundingdino.models import build_model
              from groundingdino.util.slconfig import SLConfig
              from groundingdino.util.utils import clean_state_dict
          except ImportError as e:
              raise ImportError(
                  "Please install groundingdino by: pip install git+https://github.com/IDEA-Research/GroundingDINO.git"
              )
  
          model_config_path = OVD_CUSTOM_MODELS[checkpoint_name][
              "config_file"
          ]
  
          if checkpoint_name in OVD_CUSTOM_MODELS:
              # TODO: add sha1_hash
              model_checkpoint_path = download(
                  url=OVD_CUSTOM_MODELS[checkpoint_name]["url"],
              )
          else:
              raise ValueError(
                  f"Checkpoint name not available {checkpoint_name}. All supported OVD models are {OVD_CUSTOM_MODELS.keys()}"
              )
  
          config = SLConfig.fromfile(model_config_path)
          config.device = "cpu"  # lightning will handle the device part
          model = build_model(config)
          if pretrained:
              checkpoint = torch.load(
                  model_checkpoint_path, map_location="cpu"
              )
              load_res = model.load_state_dict(
                  clean_state_dict(checkpoint["model"]), strict=False
              )
              logger.debug(f"load_res: \n{load_res}")
      else:
          raise ValueError(
              f"checkpoint name {checkpoint_name} not supported."
          )
  
      return config, model
  
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 10 for calling the OVDModel obj's underlying member method code with example usage: obj.get_ovd_config_and_model(checkpoint_name, pretrained) and returns: config,  model