code: def setup_cfg(args):
      # load config from file and command-line arguments
      cfg = get_cfg()
      cfg.merge_from_file(args.config_file)
      cfg.merge_from_list(args.opts)
      # Set score_threshold for builtin models
      cfg.MODEL.RETINANET.SCORE_THRESH_TEST = args.confidence_threshold
      cfg.MODEL.ROI_HEADS.SCORE_THRESH_TEST = args.confidence_threshold
      cfg.MODEL.PANOPTIC_FPN.COMBINE.INSTANCES_CONFIDENCE_THRESH = (
          args.confidence_threshold
      )
      cfg.freeze()
      return cfg
  
file_path: guildai/examples/detectron2/demo.py
imports: import argparse
  import glob
  import multiprocessing
  import os
  import time
  import cv2
  import tqdm
  from detectron2.config import get_cfg
  from detectron2.data.detection_utils import read_image
  from detectron2.utils.logger import setup_logger
  from predictor import VisualizationDemo
label_desc: Use image node_id 1 for calling a global function with example usage: setup_cfg(args) and returns: cfg