IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).

Mojo function

non_maximum_suppression_shape

def non_maximum_suppression_shape(boxes: T, scores: T, max_output_boxes_per_class: Int64, iou_threshold: Float32, score_threshold: Float32) -> IndexList[Int(2)]

Computes the output shape for the mo.non_maximum_suppression graph op.

Args:

  • ​boxes (T): Rank-3 tensor of bounding boxes with shape (batch, num_boxes, 4) where each box is [y1, x1, y2, x2].
  • ​scores (T): Rank-3 tensor of scores with shape (batch, num_classes, num_boxes).
  • ​max_output_boxes_per_class (Int64): Maximum number of boxes to select per class.
  • ​iou_threshold (Float32): Intersection-over-union threshold for suppression; boxes with IoU above this value are suppressed.
  • ​score_threshold (Float32): Minimum score for a box to be considered; boxes with score below this value are filtered out.

Returns:

IndexList[Int(2)]: Two-element IndexList of shape (num_selected_boxes, 3).

Was this page helpful?