code: def parse_args():
      parser = argparse.ArgumentParser(
          description="End-to-end inference"
      )
      parser.add_argument(
          "--cfg",
          dest="cfg",
          help="cfg model file (/path/to/model_config.yaml)",
          default=None,
          type=str,
      )
      parser.add_argument(
          "--wts",
          dest="weights",
          help="weights model file (/path/to/model_weights.pkl)",
          default=None,
          type=str,
      )
      parser.add_argument(
          "--output-dir",
          dest="output_dir",
          help="directory for visualization pdfs (default: /tmp/infer_simple)",
          default="/tmp/infer_simple",
          type=str,
      )
      parser.add_argument(
          "--image-ext",
          dest="image_ext",
          help="image file name extension (default: jpg)",
          default="jpg",
          type=str,
      )
      parser.add_argument(
          "im_or_folder", help="image or folder of images", default=None
      )
      if len(sys.argv) == 1:
          parser.print_help()
          sys.exit(1)
      return parser.parse_args()
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  from collections import defaultdict
  import argparse
  import cv2
  import glob
  import logging
  import os
  import sys
  import time
  from caffe2.python import workspace
  from detectron.core.config import assert_and_infer_cfg
  from detectron.core.config import cfg
  from detectron.core.config import merge_cfg_from_file
  from detectron.utils.io import cache_url
  from detectron.utils.logging import setup_logging
  from detectron.utils.timer import Timer
  import detectron.core.test_engine
  import detectron.datasets.dummy_datasets
  import detectron.utils.c2
  import detectron.utils.vis
label_desc: Use image node_id 1 for calling a global function with example usage: parse_args() and returns: parser