code: def main():
      args = parse_args()
  
      # get ann_file and img_prefix from config files
      cfg = Config.fromfile(args.config)
      dataset = args.dataset
      dataloader_cfg = cfg.get(f"{dataset}_dataloader")
      ann_file = osp.join(
          dataloader_cfg.dataset.data_root,
          dataloader_cfg.dataset.ann_file,
      )
      img_prefix = osp.join(
          dataloader_cfg.dataset.data_root,
          dataloader_cfg.dataset.data_prefix["img"],
      )
  
      # load image metas
      print_log(
          f"loading CrowdHuman {dataset} annotation...",
          level=logging.INFO,
      )
      anno_strs = get_text(ann_file).strip().split("\n")
      pool = Pool(args.nproc)
      # get image metas with multiple processes
      id_hw_temp = pool.starmap(
          get_image_metas,
          zip(anno_strs, [img_prefix for _ in range(len(anno_strs))]),
      )
      pool.close()
  
      # save image metas
      id_hw = {}
      for sub_dict in id_hw_temp:
          id_hw.update(sub_dict)
  
      data_root = osp.dirname(ann_file)
      save_path = osp.join(data_root, f"id_hw_{dataset}.json")
      print_log(
          f'\nsaving "id_hw_{dataset}.json" in "{data_root}"',
          level=logging.INFO,
      )
      dump(id_hw, save_path, file_format="json")
  
file_path: mmdetection/tools/misc/get_crowdhuman_id_hw.py
imports: import argparse
  import json
  import logging
  import os.path
  from multiprocessing import Pool
  import mmcv
  from mmengine.config import Config
  from mmengine.fileio import dump, get, get_text
  from mmengine.logging import print_log
label_desc: Use image node_id 3 for calling a global function with example usage: main() without return types