parameters: (box_scores, iou_threshold)
return_statement: return box_scores[picked, :]
docstring: Args:
          box_scores (N, 5): boxes in corner-form and probabilities.
          iou_threshold: intersection over union threshold.
      Returns:
           picked: a list of indexes of the kept boxes
function: def nms(box_scores, iou_threshold):
      """
  
      Args:
          box_scores (N, 5): boxes in corner-form and probabilities.
          iou_threshold: intersection over union threshold.
      Returns:
           picked: a list of indexes of the kept boxes
      """
      scores = box_scores[:, -1]
      boxes = box_scores[:, :-1]
      picked = []
      _, indexes = scores.sort(descending=True)
      while len(indexes) > 0:
          current = indexes[0]
          picked.append(current.item())
          if len(indexes) == 1:
              break
          current_box = boxes[current, :]
          indexes = indexes[1:]
          rest_boxes = boxes[indexes, :]
          iou = box_iou(rest_boxes, current_box.unsqueeze(0))
          indexes = indexes[iou <= iou_threshold]
  
      return box_scores[picked, :]
function_tokens: def nms ( box_scores , iou_threshold ) : scores = box_scores [ : , - 1 ] boxes = box_scores [ : , : - 1 ] picked = [ ] _ , indexes = scores . sort ( descending = True ) while len ( indexes ) > 0 : current = indexes [ 0 ] picked . append ( current . item ( ) ) if len ( indexes ) == 1 : break current_box = boxes [ current , : ] indexes = indexes [ 1 : ] rest_boxes = boxes [ indexes , : ] iou = box_iou ( rest_boxes , current_box . unsqueeze ( 0 ) ) indexes = indexes [ iou <= iou_threshold ] return box_scores [ picked , : ]