code: def yolo_map_to_bounding_boxes(
      output,
      anchors,
      confidence_threshold=0.3,
      block_size=32,
      nms_thresh=0.5,
      limit=None,
  ):
      assert output.shape[0] == 1, "For now works on single images"
      num_anchors = output.shape[-2]
      num_classes = output.shape[-1] - 5
  
      boxes = []
      classes = []
      scores = []
      for cy, cx, b in multi_range(
          output.shape[1], output.shape[2], num_anchors
      ):
          tx, ty, tw, th, tc = output[0, cy, cx, b, :5]
  
          x = (cx + sigmoid(tx)) * block_size
          y = (cy + sigmoid(ty)) * block_size
  
          w = _np.exp(tw) * anchors[b][0] * block_size
          h = _np.exp(th) * anchors[b][1] * block_size
  
          confidence = sigmoid(tc)
  
          classpreds = softmax(output[0, cy, cx, b, 5:])
  
          for i in range(num_classes):
              class_score = classpreds[i]
  
              confidence_in_class = class_score * confidence
              if confidence_in_class > confidence_threshold:
                  boxes.append(
                      [y - h / 2, x - w / 2, y + h / 2, x + w / 2]
                  )
                  classes.append(int(i))
                  scores.append(confidence_in_class)
  
      if nms_thresh is not None:
          boxes, classes, scores = non_maximum_suppression(
              boxes,
              classes,
              scores,
              num_classes=num_classes,
              threshold=nms_thresh,
              limit=None,
          )
  
      return boxes, classes, scores
  
file_path: turicreate/src/python/turicreate/toolkits/object_detector/_detection.py
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  import numpy
label_desc: Use image node_id 7 for calling a global function with example usage: yolo_map_to_bounding_boxes(output, anchors, confidence_threshold, block_size, nms_thresh, limit) and returns: boxes,  classes,  scores