code: def retrieve_yolo_detections(
      yolo_result,
      anchors,
      min_probability,
      nms_thresh,
      image_input_size,
      image_size,
      labels_dict,
  ):
      boxes = []
  
      for i in range(len(yolo_result)):
          # decode the output of the network
          boxes += decode_netout(
              yolo_result[i][0],
              anchors[i],
              min_probability,
              nms_thresh,
              image_input_size[0],
              image_input_size[1],
          )
  
      # correct the sizes of the bounding boxes
      correct_yolo_boxes(
          boxes,
          image_size[1],
          image_size[0],
          image_input_size[0],
          image_input_size[1],
      )
  
      # suppress non-maximal boxes
      do_nms(boxes, nms_thresh)
  
      detections = list()
      for box in boxes:
          label = -1
  
          for i in range(len(labels_dict.keys())):
              if box.classes[i] > min_probability:
                  label = labels_dict[i]
  
                  percentage_probability = box.classes[i] * 100
                  xmin = box.xmin
                  ymin = box.ymin
                  xmax = box.xmax
                  ymax = box.ymax
  
                  if xmin < 0:
                      xmin = 0
  
                  if ymin < 0:
                      ymin = 0
  
                  detection = dict()
                  detection["name"] = label
                  detection[
                      "percentage_probability"
                  ] = percentage_probability
                  detection["box_points"] = [xmin, ymin, xmax, ymax]
  
                  detections.append(detection)
  
      return detections
  
imports: import tensorflow
  from keras import backend
  import numpy
  from PIL import Image
  import cv2
label_desc: Use image node_id 13 for calling a global function with example usage: retrieve_yolo_detections(yolo_result, anchors, min_probability, nms_thresh, image_input_size, image_size, labels_dict) and returns: detections