docstr: Load config from file.
  Args:
      file_path (str): Path of the config file to be loaded.
  Returns: global config
docstr_tok: ["Load","config","from","file",".","Args",":","file_path","(","str",")",":","Path","of","the","config","file","to","be","loaded",".","Returns",":","global","config"]
code: def _load_config_with_base(self, file_path):
      """
      Load config from file.
      Args:
          file_path (str): Path of the config file to be loaded.
      Returns: global config
      """
      _, ext = os.path.splitext(file_path)
      assert ext in [".yml", ".yaml"], "only support yaml files for now"
  
      with open(file_path) as f:
          file_cfg = yaml.load(f, Loader=yaml.Loader)
  
      # NOTE: cfgs outside have higher priority than cfgs in _BASE_
      if self.BASE_KEY in file_cfg:
          all_base_cfg = dict()
          base_ymls = list(file_cfg[self.BASE_KEY])
          for base_yml in base_ymls:
              with open(base_yml) as f:
                  base_cfg = self._load_config_with_base(base_yml)
                  all_base_cfg = _merge_dict(all_base_cfg, base_cfg)
  
          del file_cfg[self.BASE_KEY]
          file_cfg = _merge_dict(all_base_cfg, file_cfg)
      file_cfg["filename"] = os.path.splitext(
          os.path.split(file_path)[-1]
      )[0]
      return file_cfg
  
imports: import json
  import pathlib
  import time
  import os
  import glob
  import cv2
  import yaml
  from typing import Mapping
  import matplotlib.pyplot
  import numpy
  from argparse import ArgumentParser, RawDescriptionHelpFormatter
label_desc: Use image node_id 2 for calling the Config obj's underlying member method code with example usage: obj._load_config_with_base(file_path) and returns: file_cfg