code: def main():
      parser = argparse.ArgumentParser(
          description="Run StyleGAN2 metrics.",
          epilog=_examples,
          formatter_class=argparse.RawDescriptionHelpFormatter,
      )
      parser.add_argument(
          "--result-dir",
          help="Root directory for run results (default: %(default)s)",
          default="results",
          metavar="DIR",
      )
      parser.add_argument(
          "--network",
          help="Network pickle filename",
          dest="network_pkl",
          required=True,
      )
      parser.add_argument(
          "--metrics",
          help="Metrics to compute (default: %(default)s)",
          default="fid50k",
          type=lambda x: x.split(","),
      )
      parser.add_argument(
          "--dataset", help="Training dataset", required=True
      )
      parser.add_argument(
          "--data-dir", help="Dataset root directory", required=True
      )
      parser.add_argument(
          "--mirror-augment",
          help="Mirror augment (default: %(default)s)",
          default=False,
          type=_str_to_bool,
          metavar="BOOL",
      )
      parser.add_argument(
          "--num-gpus",
          help="Number of GPUs to use",
          type=int,
          default=1,
          metavar="N",
      )
  
      args = parser.parse_args()
  
      if not os.path.exists(args.data_dir):
          print("Error: dataset root directory does not exist.")
          sys.exit(1)
  
      kwargs = vars(args)
      sc = dnnlib.SubmitConfig()
      sc.num_gpus = kwargs.pop("num_gpus")
      sc.submit_target = dnnlib.SubmitTarget.LOCAL
      sc.local.do_not_copy_source_files = True
      sc.run_dir_root = kwargs.pop("result_dir")
      sc.run_desc = "run-metrics"
      dnnlib.submit_run(sc, "run_metrics.run", **kwargs)
  
file_path: insightface/reconstruction/ostec/external/stylegan2/run_metrics.py
imports: import argparse
  import os
  import sys
  import dnnlib
  import dnnlib.tflib
  import pretrained_networks
  from metrics import metric_base
  from metrics.metric_defaults import metric_defaults
label_desc: Use image node_id 3 for calling a global function with example usage: main() without return types