Skip to main content

postprocess_boxes_multilabel_index_float

Function postprocess_boxes_multilabel_index_float 

Source
pub fn postprocess_boxes_multilabel_index_float<B: BBoxTypeTrait, BOX: Float + AsPrimitive<f32> + Send + Sync, SCORE: Float + AsPrimitive<f32> + Send + Sync>(
    threshold: SCORE,
    boxes: ArrayView2<'_, BOX>,
    scores: ArrayView2<'_, SCORE>,
) -> Vec<(DetectBox, usize)>
Expand description

Multi-label variant of postprocess_boxes_index_float.

For each anchor row, emits one (DetectBox, anchor_idx) per class whose score meets threshold — every class, not just the argmax. The same anchor_idx is returned for all per-class entries of a given anchor so that downstream mask-coefficient lookup can reuse the shared coefficient row.

The bbox is computed once per anchor (via B::ndarray_to_xyxy_float) and reused across all emitted classes, avoiding redundant work.

Intended for validation/mAP evaluation only (the Ultralytics val convention). Deployment must use the argmax variant postprocess_boxes_index_float so trackers see at most one box per anchor.