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[dtype: DType](boxes: ManagedTensorSlice[IOSpec[_, _].Input, static_spec=boxes.static_spec], scores: ManagedTensorSlice[IOSpec[_, _].Input, static_spec=scores.static_spec], 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.

Parameters:

  • ​dtype (DType): Element type of the boxes and scores tensors.

Args:

Returns:

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