code: def main():
      args = parse_args()
  
      cfg = Config.fromfile(args.config)
      init_default_scope(cfg.get("default_scope", "mmdet"))
  
      if args.cfg_options is not None:
          cfg.merge_from_dict(args.cfg_options)
  
      dataset = DATASETS.build(cfg.test_dataloader.dataset)
      predictions = mmengine.load(args.pkl_results)
  
      evaluator = Evaluator(cfg.val_evaluator)
      evaluator.dataset_meta = dataset.metainfo
      eval_results = evaluator.offline_evaluate(predictions)
      print(eval_results)
  
imports: import argparse
  import mmengine
  from mmengine import Config, DictAction
  from mmengine.evaluator import Evaluator
  from mmengine.registry import init_default_scope
  from mmdet.registry import DATASETS
label_desc: Use image node_id 2 for calling a global function with example usage: main() without return types