otx.api.utils.nms#

NMS Module.

Functions

multiclass_nms(detections[, iou_threshold, ...])

Multi-class NMS.

nms(boxes, scores, thresh)

Adapted NMS implementation from OMZ: model_zoo/model_api/models/utils.py#L181.

otx.api.utils.nms.multiclass_nms(detections: ndarray, iou_threshold=0.45, max_num=200)[source]#

Multi-class NMS.

strategy: in order to perform NMS independently per class, we add an offset to all the boxes. The offset is dependent only on the class idx, and is large enough so that boxes from different classes do not overlap

Parameters:
  • detections (np.ndarray) – labels, scores and boxes

  • iou_threshold (float, optional) – IoU threshold. Defaults to 0.45.

  • max_num (int, optional) – Max number of objects filter. Defaults to 200.

Returns:

(dets, indices), Dets are boxes with scores. Indices are indices of kept boxes.

Return type:

tuple

otx.api.utils.nms.nms(boxes, scores, thresh)[source]#

Adapted NMS implementation from OMZ: model_zoo/model_api/models/utils.py#L181.