Expand description
Float-domain NMS and box geometry.
Two groups of primitives, both reusable outside the decoder:
- Suppression —
nms_float,nms_class_aware_float, and the_extravariants that carry a per-box payload (mask coefficients, say) through suppression so the survivors stay paired with their data. - Geometry —
intersection_area,box_area,iou_value, andios_value. The tiled-inference merge incrate::tilingshares these, which is what keeps its IoS metric numerically identical to the IoU used by ordinary NMS.
jaccard and jaccard_batch4 are the threshold-test forms used on the
suppression hot path; they answer “do these overlap past iou?” without
materializing the ratio.
Functions§
- box_
area - Area of a box, clamped to
>= 0per side. Mirrors ModelPack_areas. - intersection_
area - Area of the axis-aligned intersection of two boxes, clamped to
>= 0per side. Mirrors theinterterm in ModelPackmetrics/tiled.py::_match. - ios_
value - Intersection-over-Smaller value in
[0, 1]. Mirrors ModelPack_match(metric='ios'):inter / max(min(area_a, area_b), 1e-9). Used by the tiled-detection merge: a seam-split object has low IoU but high IoS. - iou_
value - Intersection-over-Union value in
[0, 1]. Mirrors ModelPack_match(metric='iou'):inter / max(area_a + area_b - inter, 1e-9). - jaccard
- Returns true if the IOU of the given bounding boxes is greater than the iou threshold
- jaccard_
batch4 - Batch IoU check: test one reference box
aagainst 4 candidate boxes. - nms_
class_ aware_ float - Class-aware NMS: only suppress boxes with the same label.
- nms_
extra_ class_ aware_ float - Class-aware NMS with extra data: only suppress boxes with the same label.
- nms_
extra_ float - Uses NMS to filter boxes based on the score and iou. Sorts boxes by score, then greedily selects a subset of boxes in descending order of score.
- nms_
float - Uses NMS to filter boxes based on the score and iou. Sorts boxes by score, then greedily selects a subset of boxes in descending order of score.
- postprocess_
boxes_ float - Post processes boxes and scores tensors into detection boxes, filtering out any boxes below the score threshold. The boxes tensor is converted to XYXY using the given BBoxTypeTrait. The order of the boxes is preserved.
- postprocess_
boxes_ index_ float - Post processes boxes and scores tensors into detection boxes, filtering out any boxes below the score threshold. The boxes tensor is converted to XYXY using the given BBoxTypeTrait. The order of the boxes is preserved.
- postprocess_
boxes_ multilabel_ index_ float - Multi-label variant of
postprocess_boxes_index_float.