code: def compute_rpn_proposals(
      rpn_model, image_input, roi_input, dims_input, cfg
  ):
      num_images = cfg["DATA"].NUM_TRAIN_IMAGES
      # Create the minibatch source
      od_minibatch_source = ObjectDetectionMinibatchSource(
          cfg["DATA"].TRAIN_MAP_FILE,
          cfg["DATA"].TRAIN_ROI_FILE,
          num_classes=cfg["DATA"].NUM_CLASSES,
          max_annotations_per_image=cfg.INPUT_ROIS_PER_IMAGE,
          pad_width=cfg.IMAGE_WIDTH,
          pad_height=cfg.IMAGE_HEIGHT,
          pad_value=cfg["MODEL"].IMG_PAD_COLOR,
          max_images=num_images,
          randomize=False,
          use_flipping=False,
          proposal_provider=None,
      )
  
      # define mapping from reader streams to network inputs
      input_map = {
          od_minibatch_source.image_si: image_input,
          od_minibatch_source.roi_si: roi_input,
          od_minibatch_source.dims_si: dims_input,
      }
  
      buffered_proposals = [None for _ in range(num_images)]
      sample_count = 0
      while sample_count < num_images:
          data = od_minibatch_source.next_minibatch(
              1, input_map=input_map
          )
          output = rpn_model.eval(data)
          out_dict = dict([(k.name, k) for k in output])
          out_rpn_rois = output[out_dict["rpn_rois"]][0]
          buffered_proposals[sample_count] = np.round(
              out_rpn_rois
          ).astype(np.int16)
          sample_count += 1
          if sample_count % 500 == 0:
              print(
                  "Buffered proposals for {} samples".format(
                      sample_count
                  )
              )
  
      return buffered_proposals
  
imports: from __future__ import print_function
  import numpy
  import os, sys
  import argparse
  import easydict
  import cntk
  from cntk import Trainer, load_model, Axis, input_variable, parameter, times, combine, softmax, roipooling, plus, element_times, CloneMethod, alias, Communicator, reduce_sum
  from cntk.core import Value
  from cntk.io import MinibatchData
  from cntk.initializer import normal
  from cntk.layers import placeholder, Constant, Sequential
  from cntk.learners import momentum_sgd, learning_parameter_schedule_per_sample, momentum_schedule
  from cntk.logging import log_number_of_parameters, ProgressPrinter
  from cntk.logging.graph import find_by_name, plot
  from cntk.losses import cross_entropy_with_softmax
  from cntk.metrics import classification_error
  from _cntk_py import force_deterministic_algorithms
  from utils.rpn.rpn_helpers import create_rpn, create_proposal_target_layer, create_proposal_layer
  from utils.annotations.annotations_helper import parse_class_map_file
  from utils.od_mb_source import ObjectDetectionMinibatchSource
  from utils.proposal_helpers import ProposalProvider
  from FastRCNN.FastRCNN_train import clone_model, clone_conv_layers, create_fast_rcnn_predictor, create_detection_losses
label_desc: Use image node_id 6 for calling a global function with example usage: compute_rpn_proposals(rpn_model, image_input, roi_input, dims_input, cfg) and returns: buffered_proposals