vis4d.op.detect3d.util¶
Utilitiy functions for detection 3D ops.
Functions
|
Performs non-maximum suppression in a batched fashion. |
|
BEV 3D NMS. |
- batched_nms_rotated(boxes, scores, idxs, iou_threshold)[source]¶
Performs non-maximum suppression in a batched fashion.
Each index value correspond to a category, and NMS will not be applied between elements of different categories.
- Parameters:
boxes (Tensor) – Boxes where NMS will be performed. They are expected to be in (x_ctr, y_ctr, width, height, angle_degrees) format. In shape (N, 5).
scores (Tensor) – Scores for each one of the boxes. In shape (N,).
idxs (Tensor) – Indices of the categories for each one of the boxes. In shape (N,).
iou_threshold (float) – Discards all overlapping boxes with IoU < iou_threshold.
- Returns:
- Int64 tensor with the indices of the elements that have been
kept by NMS, sorted in decreasing order of scores
- Return type:
Tensor
- bev_3d_nms(center_x, center_y, width, length, angle, scores, class_ids=None, iou_threshold=0.1)[source]¶
BEV 3D NMS.
- Parameters:
center_x (Tensor) – Center x of boxes. In shape (N, 1).
center_y (Tensor) – Center y of boxes. In shape (N, 1).
width (Tensor) – Width of boxes. In shape (N, 1).
length (Tensor) – Length of boxes. In shape (N, 1).
angle (Tensor) – Angle of boxes. In shape (N, 1).
scores (Tensor) – Scores of boxes. In shape (N, 1).
class_ids (Tensor | None, optional) – Class ids of boxes. In shape (N,). Defaults to None. If None, class_agnostic NMS will be performed.
iou_threshold (float, optional) – IoU threshold. Defaults to 0.1.
- Returns:
Indices of boxes that have been kept by NMS.
- Return type:
Tensor