parameters: (boxes, scores, threshold)
return_statement: return np.array(pick, dtype=np.int32)
docstring: Performs non-maximum supression and returns indicies of kept boxes.
      boxes: [N, (y1, x1, y2, x2)]. Notice that (y2, x2) lays outside the box.
      scores: 1-D array of box scores.
      threshold: Float. IoU threshold to use for filtering.
docstring_summary: Performs non-maximum supression and returns indicies of kept boxes.
      boxes: [N, (y1, x1, y2, x2)]. Notice that (y2, x2) lays outside the box.
      scores: 1-D array of box scores.
      threshold: Float. IoU threshold to use for filtering.
docstring_tokens: Performs non - maximum supression and returns indicies of kept boxes . boxes : [ N ( y1 x1 y2 x2 ) ] . Notice that ( y2 x2 ) lays outside the box . scores : 1 - D array of box scores . threshold : Float . IoU threshold to use for filtering .
function: def non_max_suppression(boxes, scores, threshold):
      """Performs non-maximum supression and returns indicies of kept boxes.
      boxes: [N, (y1, x1, y2, x2)]. Notice that (y2, x2) lays outside the box.
      scores: 1-D array of box scores.
      threshold: Float. IoU threshold to use for filtering.
      """
      assert boxes.shape[0] > 0
      if boxes.dtype.kind != "f":
          boxes = boxes.astype(np.float32)
  
      # Compute box areas
      y1 = boxes[:, 0]
      x1 = boxes[:, 1]
      y2 = boxes[:, 2]
      x2 = boxes[:, 3]
      area = (y2 - y1) * (x2 - x1)
  
      # Get indicies of boxes sorted by scores (highest first)
      ixs = scores.argsort()[::-1]
  
      pick = []
      while len(ixs) > 0:
          # Pick top box and add its index to the list
          i = ixs[0]
          pick.append(i)
          # Compute IoU of the picked box with the rest
          iou = compute_iou(boxes[i], boxes[ixs[1:]], area[i], area[ixs[1:]])
          # Identify boxes with IoU over the threshold. This
          # returns indicies into ixs[1:], so add 1 to get
          # indicies into ixs.
          remove_ixs = np.where(iou > threshold)[0] + 1
          # Remove indicies of the picked and overlapped boxes.
          ixs = np.delete(ixs, remove_ixs)
          ixs = np.delete(ixs, 0)
      return np.array(pick, dtype=np.int32)
function_tokens: def non_max_suppression ( boxes , scores , threshold ) : assert boxes . shape [ 0 ] > 0 if boxes . dtype . kind != "f" : boxes = boxes . astype ( np . float32 ) # Compute box areas y1 = boxes [ : , 0 ] x1 = boxes [ : , 1 ] y2 = boxes [ : , 2 ] x2 = boxes [ : , 3 ] area = ( y2 - y1 ) * ( x2 - x1 ) # Get indicies of boxes sorted by scores (highest first) ixs = scores . argsort ( ) [ : : - 1 ] pick = [ ] while len ( ixs ) > 0 : # Pick top box and add its index to the list i = ixs [ 0 ] pick . append ( i ) # Compute IoU of the picked box with the rest iou = compute_iou ( boxes [ i ] , boxes [ ixs [ 1 : ] ] , area [ i ] , area [ ixs [ 1 : ] ] ) # Identify boxes with IoU over the threshold. This # returns indicies into ixs[1:], so add 1 to get # indicies into ixs. remove_ixs = np . where ( iou > threshold ) [ 0 ] + 1 # Remove indicies of the picked and overlapped boxes. ixs = np . delete ( ixs , remove_ixs ) ixs = np . delete ( ixs , 0 ) return np . array ( pick , dtype = np . int32 )