code: def create_faster_rcnn_eval_model(
      model, image_input, dims_input, cfg, rpn_model=None
  ):
      print("creating eval model")
      last_conv_node_name = cfg["MODEL"].LAST_CONV_NODE_NAME
      conv_layers = clone_model(
          model,
          [cfg["MODEL"].FEATURE_NODE_NAME],
          [last_conv_node_name],
          CloneMethod.freeze,
      )
      conv_out = conv_layers(image_input)
  
      model_with_rpn = model if rpn_model is None else rpn_model
      rpn = clone_model(
          model_with_rpn,
          [last_conv_node_name],
          ["rpn_cls_prob_reshape", "rpn_bbox_pred"],
          CloneMethod.freeze,
      )
      rpn_out = rpn(conv_out)
      # we need to add the proposal layer anew to account for changing configs when buffering proposals in 4-stage training
      rpn_rois = create_proposal_layer(
          rpn_out.outputs[0], rpn_out.outputs[1], dims_input, cfg
      )
  
      roi_fc_layers = clone_model(
          model,
          [last_conv_node_name, "rpn_target_rois"],
          ["cls_score", "bbox_regr"],
          CloneMethod.freeze,
      )
      pred_net = roi_fc_layers(conv_out, rpn_rois)
      cls_score = pred_net.outputs[0]
      bbox_regr = pred_net.outputs[1]
  
      if cfg.BBOX_NORMALIZE_TARGETS:
          num_boxes = int(bbox_regr.shape[1] / 4)
          bbox_normalize_means = np.array(
              cfg.BBOX_NORMALIZE_MEANS * num_boxes
          )
          bbox_normalize_stds = np.array(
              cfg.BBOX_NORMALIZE_STDS * num_boxes
          )
          bbox_regr = plus(
              element_times(bbox_regr, bbox_normalize_stds),
              bbox_normalize_means,
              name="bbox_regr",
          )
  
      cls_pred = softmax(cls_score, axis=1, name="cls_pred")
      eval_model = combine([cls_pred, rpn_rois, bbox_regr])
  
      return eval_model
  
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 4 for calling a global function with example usage: create_faster_rcnn_eval_model(model, image_input, dims_input, cfg, rpn_model) and returns: eval_model