code: def non_maximum_suppression(
      boxes, classes, scores, num_classes, threshold=0.5, limit=None
  ):
      np_scores = _np.array(scores)
      np_boxes = _np.array(boxes)
      np_classes = _np.array(classes)
  
      new_boxes = []
      new_classes = []
      new_scores = []
      for c in range(num_classes):
          c_scores = np_scores[np_classes == c]
          c_boxes = np_boxes[np_classes == c]
          ii = _np.argsort(c_scores)[::-1]
          c_scores = c_scores[ii]
          c_boxes = c_boxes[ii]
          keep = _np.ones(len(c_scores)).astype(_np.bool)
          for i in range(len(c_scores)):
              if keep[i]:
                  ious = intersection_over_union(
                      c_boxes[[i]], c_boxes[i + 1 :]
                  )[0]
                  keep[i + 1 :] &= ious <= threshold
  
          c_scores = c_scores[keep]
          c_boxes = c_boxes[keep]
  
          new_boxes.extend(c_boxes)
          new_classes.extend(_np.full(len(c_boxes), c, dtype=_np.int32))
          new_scores.extend(c_scores)
  
      new_boxes = _np.array(new_boxes).reshape(-1, 4)
      new_scores = _np.array(new_scores)
      new_classes = _np.array(new_classes)
  
      ii = _np.argsort(-new_scores)[:limit]
  
      new_boxes = new_boxes[ii]
      new_scores = new_scores[ii]
      new_classes = new_classes[ii]
  
      return new_boxes, new_classes, new_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 6 for calling a global function with example usage: non_maximum_suppression(boxes, classes, scores, num_classes, threshold, limit) and returns: new_boxes,  new_classes,  new_scores