code: def build_model_from_cfg(config_path, checkpoint_path):
      """Build a model from config and load the given checkpoint.
  
      Args:
          config_path (str): the OpenMMLab config for the model we want to
              export to ONNX
          checkpoint_path (str): Path to the corresponding checkpoint
  
      Returns:
          torch.nn.Module: the built model
      """
      from mmdet.models import build_detector
  
      cfg = mmcv.Config.fromfile(config_path)
      # import modules from string list.
      if cfg.get("custom_imports", None):
          from mmcv.utils import import_modules_from_strings
  
          import_modules_from_strings(**cfg["custom_imports"])
      cfg.model.pretrained = None
      cfg.data.test.test_mode = True
  
      # build the model
      model = build_detector(
          cfg.model, train_cfg=None, test_cfg=cfg.test_cfg
      )
      load_checkpoint(model, checkpoint_path, map_location="cpu")
      model.cpu().eval()
      return model
  
file_path: insightface/detection/scrfd/mmdet/core/export/pytorch2onnx.py
imports: from functools import partial
  import mmcv
  import numpy
  import torch
  from mmcv.runner import load_checkpoint
label_desc: Use image node_id 2 for calling a global function with example usage: build_model_from_cfg(config_path, checkpoint_path) and returns: model