code: def non_max_supression(
      boxes: np.ndarray, scores: np.ndarray, iou_threshold: float
  ) -> np.ndarray:
      """Perform non-max supression.
  
      Args:
          boxes: np.ndarray
              Predicted bounding boxes, shape (num_of_boxes, 4)
          scores: np.ndarray
              Confidence for predicted bounding boxes, shape (num_of_boxes).
          iou_threshold: float
              Maximum allowed overlap between bounding boxes.
  
      Returns:
          np.ndarray: Filtered bounding boxes
      """
      # Sort by score
      sorted_indices = np.argsort(scores)[::-1]
  
      keep_boxes = []
      while sorted_indices.size > 0:
          # Pick the last box
          box_id = sorted_indices[0]
          keep_boxes.append(box_id)
  
          # Compute IoU of the picked box with the rest
          ious = compute_iou(
              boxes[box_id, :], boxes[sorted_indices[1:], :]
          )
  
          # Remove boxes with IoU over the threshold
          keep_indices = np.where(ious < iou_threshold)[0]
  
          # print(keep_indices.shape, sorted_indices.shape)
          sorted_indices = sorted_indices[keep_indices + 1]
  
      return keep_boxes
  
file_path: sahi/sahi/utils/yolov8onnx.py
imports: from pathlib import Path
  from typing import Optional
  import numpy
  from sahi.utils.yolov8 import download_yolov8n_model
label_desc: Use image node_id 2 for calling a global function with example usage: non_max_supression(boxes, scores, iou_threshold) and returns: keep_boxes