code: def main():
      args = parse_args()
      cfg = Config.fromfile(args.config)
      if args.cfg_options is not None:
          cfg.merge_from_dict(args.cfg_options)
  
      init_default_scope(cfg.get("default_scope", "mmdet"))
  
      distributed = False
      if args.launcher != "none":
          init_dist(
              args.launcher,
              **cfg.get("env_cfg", {}).get("dist_cfg", {}),
          )
          distributed = True
  
      log_file = None
      if args.work_dir:
          log_file = os.path.join(args.work_dir, "benchmark.log")
          mkdir_or_exist(args.work_dir)
  
      logger = MMLogger.get_instance(
          "mmdet", log_file=log_file, log_level="INFO"
      )
  
      benchmark = eval(f"{args.task}_benchmark")(
          args, cfg, distributed, logger
      )
      benchmark.run(args.repeat_num)
  
file_path: mmdetection/tools/analysis_tools/benchmark.py
imports: import argparse
  import os
  from mmengine import MMLogger
  from mmengine.config import Config, DictAction
  from mmengine.dist import init_dist
  from mmengine.registry import init_default_scope
  from mmengine.utils import mkdir_or_exist
  from mmdet.utils.benchmark import DataLoaderBenchmark, DatasetBenchmark, InferenceBenchmark
label_desc: Use image node_id 5 for calling a global function with example usage: main() without return types