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 theboxesandscorestensors.
Args:
- βboxes (
ManagedTensorSlice[IOSpec[_, _].Input, static_spec=boxes.static_spec]): Rank-3 tensor of bounding boxes with shape(batch, num_boxes, 4)where each box is[y1, x1, y2, x2]. - βscores (
ManagedTensorSlice[IOSpec[_, _].Input, static_spec=scores.static_spec]): 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).