parameters: (boxes, scores, iou_threshold, top_k=-1, candidate_size=200)
return_statement: return picked
docstring: Args:
          box_scores (N, 5): boxes in corner-form(x1, y1, x2, y2) and probabilities.
          iou_threshold: intersection over union threshold.
          top_k: keep top_k results. If k <= 0, keep all the results.
          candidate_size: only consider the candidates with the highest scores.
      Returns:
           picked: a list of indexes of the kept boxes
function: def nms(boxes, scores, iou_threshold, top_k=-1, candidate_size=200):
      """
  
      Args:
          box_scores (N, 5): boxes in corner-form(x1, y1, x2, y2) and probabilities.
          iou_threshold: intersection over union threshold.
          top_k: keep top_k results. If k <= 0, keep all the results.
          candidate_size: only consider the candidates with the highest scores.
      Returns:
           picked: a list of indexes of the kept boxes
      """
  
      picked = []
      indexes = np.argsort(scores)
      indexes = indexes[-candidate_size:]
      while len(indexes) > 0:
          current = indexes[-1]
          picked.append(current)
          if 0 < top_k == len(picked) or len(indexes) == 1:
              break
  
          current_box = boxes[current, :]
          indexes = indexes[:-1]
          rest_boxes = boxes[indexes, :]
          iou = iou_of(
              rest_boxes,
              np.expand_dims(current_box, axis=0),
          )
          indexes = indexes[iou <= iou_threshold]
  
      return picked
function_tokens: def nms ( boxes , scores , iou_threshold , top_k = - 1 , candidate_size = 200 ) : picked = [ ] indexes = np . argsort ( scores ) indexes = indexes [ - candidate_size : ] while len ( indexes ) > 0 : current = indexes [ - 1 ] picked . append ( current ) if 0 < top_k == len ( picked ) or len ( indexes ) == 1 : break current_box = boxes [ current , : ] indexes = indexes [ : - 1 ] rest_boxes = boxes [ indexes , : ] iou = iou_of ( rest_boxes , np . expand_dims ( current_box , axis = 0 ) , ) indexes = indexes [ iou <= iou_threshold ] return picked