code: def measure_inference_time(model, img_path, cfg, num_repetitions=100):
      """
      Computes detection results for the given model on the provided image
      :param model: the model
      :param img_path: the path to the image
      :param cfg: the configuration
      :return:
          regressed_rois - the predicted bounding boxes
          cls_probs - class probabilities per bounding box
      """
  
      detector_name = _get_detector_name(cfg)
      print(
          "Measuring inference time (seconds per image) as average over {} runs".format(
              num_repetitions
          )
      )
      if detector_name == "FastRCNN":
          from FastRCNN.FastRCNN_eval import FastRCNN_Evaluator
  
          evaluator = FastRCNN_Evaluator(model, cfg)
      elif detector_name == "FasterRCNN":
          from FasterRCNN.FasterRCNN_eval import FasterRCNN_Evaluator
  
          evaluator = FasterRCNN_Evaluator(model, cfg)
      else:
          print("Unknown detector: {}".format(detector_name))
          return
  
      from time import time
  
      start = time()
      for i in range(num_repetitions):
          _, _ = evaluator.process_image(img_path)
      total = time() - start
      print(
          "seconds per image: {:2f} (total for {} images: {:2f})".format(
              total / num_repetitions, num_repetitions, total
          )
      )
  
file_path: CNTK/Examples/Image/Detection/utils/od_utils.py
imports: import easydict
  from utils.nms_wrapper import apply_nms_to_single_image_results
label_desc: Use image node_id 7 for calling a global function with example usage: measure_inference_time(model, img_path, cfg, num_repetitions) without return types