code: def main():
      global global_config
      all_config = load_slim_config(FLAGS.config_path)
      assert (
          "Global" in all_config
      ), "Key 'Global' not found in config file."
      global_config = all_config["Global"]
      reader_cfg = load_config(global_config["reader_config"])
  
      dataset = reader_cfg["EvalDataset"]
      global val_loader
      val_loader = create("EvalReader")(
          reader_cfg["EvalDataset"],
          reader_cfg["worker_num"],
          return_list=True,
      )
      metric = None
      if reader_cfg["metric"] == "COCO":
          clsid2catid = {v: k for k, v in dataset.catid2clsid.items()}
          anno_file = dataset.get_anno()
          metric = COCOMetric(
              anno_file=anno_file,
              clsid2catid=clsid2catid,
              IouType="bbox",
          )
      elif reader_cfg["metric"] == "VOC":
          metric = VOCMetric(
              label_list=dataset.get_label_list(),
              class_num=reader_cfg["num_classes"],
              map_type=reader_cfg["map_type"],
          )
      elif reader_cfg["metric"] == "KeyPointTopDownCOCOEval":
          anno_file = dataset.get_anno()
          metric = KeyPointTopDownCOCOEval(
              anno_file, len(dataset), 17, "output_eval"
          )
      else:
          raise ValueError(
              "metric currently only supports COCO and VOC."
          )
      global_config["metric"] = metric
  
      eval()
  
file_path: PaddleDetection/deploy/auto_compression/eval.py
imports: import os
  import sys
  import numpy
  import argparse
  import paddle
  from ppdet.core.workspace import load_config, merge_config
  from ppdet.core.workspace import create
  from ppdet.metrics import COCOMetric, VOCMetric, KeyPointTopDownCOCOEval
  from paddleslim.auto_compression.config_helpers import load_config
  from post_process import PPYOLOEPostProcess
label_desc: Use image node_id 5 for calling a global function with example usage: main() without return types