code: def get_rpn_box_proposals(im, args):
      cfg.immutable(False)
      merge_cfg_from_file(args.rpn_cfg)
      cfg.NUM_GPUS = 1
      cfg.MODEL.RPN_ONLY = True
      cfg.TEST.RPN_PRE_NMS_TOP_N = 10000
      cfg.TEST.RPN_POST_NMS_TOP_N = 2000
      assert_and_infer_cfg(cache_urls=False)
  
      model = model_engine.initialize_model_from_cfg(args.rpn_pkl)
      with c2_utils.NamedCudaScope(0):
          boxes, scores = rpn_engine.im_proposals(model, im)
      return boxes, scores
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  import argparse
  import cv2
  import logging
  import os
  import sys
  import yaml
  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 load_cfg
  from detectron.core.config import merge_cfg_from_cfg
  from detectron.core.config import merge_cfg_from_file
  from detectron.utils.io import cache_url
  from detectron.utils.logging import setup_logging
  import detectron.core.rpn_generator
  import detectron.core.test_engine
  import detectron.datasets.dummy_datasets
  import detectron.utils.c2
  import detectron.utils.vis
label_desc: Use image node_id 2 for calling a global function with example usage: get_rpn_box_proposals(im, args) and returns: boxes,  scores