code: def yolo_eval(
      yolo_outputs,
      anchors,
      num_classes,
      image_shape,
      max_boxes=20,
      score_threshold=0.6,
      iou_threshold=0.5,
  ):
      """Evaluate YOLO model on given input and return filtered boxes."""
      # yolo_outputs order 13,26,52
  
      input_shape = K.shape(yolo_outputs[0])[1:3] * 32
  
      for i in range(0, 3):
          _boxes, _box_scores = yolo_boxes_and_scores(
              yolo_outputs[i],
              anchors[6 - 3 * i : 9 - 3 * i],
              num_classes,
              input_shape,
              image_shape,
          )
          if i == 0:
              boxes, box_scores = _boxes, _box_scores
          else:
              boxes = K.concatenate([boxes, _boxes], axis=0)
              box_scores = K.concatenate(
                  [box_scores, _box_scores], axis=0
              )
  
      mask = box_scores >= score_threshold
      max_boxes_tensor = K.constant(max_boxes, dtype="int32")
      for i in range(num_classes):
          # TODO: use keras backend instead of tf.
          class_boxes = tf.boolean_mask(boxes, mask[:, i])
          class_box_scores = tf.boolean_mask(
              box_scores[:, i], mask[:, i]
          )
          nms_index = tf.image.non_max_suppression(
              class_boxes,
              class_box_scores,
              max_boxes_tensor,
              iou_threshold=iou_threshold,
          )
          class_boxes = K.gather(class_boxes, nms_index)
          class_box_scores = K.gather(class_box_scores, nms_index)
          classes = K.ones_like(class_box_scores, "int32") * i
          if i == 0:
              boxes_, scores_, classes_ = (
                  class_boxes,
                  class_box_scores,
                  classes,
              )
          else:
              boxes_ = K.concatenate([boxes_, class_boxes], axis=0)
              scores_ = K.concatenate(
                  [scores_, class_box_scores], axis=0
              )
              classes_ = K.concatenate([classes_, classes], axis=0)
      return boxes_, scores_, classes_
  
file_path: MMdnn/mmdnn/conversion/examples/keras/utils.py
imports: import tensorflow
  from keras import backend
  from PIL import Image
label_desc: Use image node_id 5 for calling a global function with example usage: yolo_eval(yolo_outputs, anchors, num_classes, image_shape, max_boxes, score_threshold, iou_threshold) and returns: boxes_,  scores_,  classes_