def bev_nms(
    boxes3d, scores, iou_threshold, pose_cam_global=CAMERA_TO_VEHICLE_ROTATION, class_idxs=None, class_agnostic=False
):
    """

    Parameters
    ----------
    boxes3d: Boxes3D
        3D boxes in camera frame.

    scores: Tensor
        1D score vector. Must be of same size 'boxes3d'

    iou_threshold: float
        Two rotated boxes in BEV frame cannot overlap (according to IoU) more than this threshold.

    class_idxs: Tensor or None
        If not None, 1D integer vector. Must be of same size 'boxes3d'

    class_agnostic: bool
        If True, then category ID is not considered in NMS.
        If False, then NMS is performed per-cateogry ('class_idxs' must not be None.)

    Returns
    -------
    keep: Tensor
        1D integer vector that contains filtered indices to 'boxes3d' to keep after NMS.
    """
    rot_boxes = boxes3d_to_rotated_boxes(boxes3d, pose_cam_global=pose_cam_global)
    if class_agnostic:
        class_idxs = torch.zeros_like(scores, dtype=torch.int64)
    else:
        assert class_idxs is not None
    keep = batched_nms_rotated(rot_boxes.tensor, scores, class_idxs, iou_threshold)
    return keep


    Parameters
    ----------
    boxes3d: Boxes3D
        3D boxes in camera frame.

    scores: Tensor
        1D score vector. Must be of same size 'boxes3d'

    iou_threshold: float
        Two rotated boxes in BEV frame cannot overlap (according to IoU) more than this threshold.

    class_idxs: Tensor or None
        If not None, 1D integer vector. Must be of same size 'boxes3d'

    class_agnostic: bool
        If True, then category ID is not considered in NMS.
        If False, then NMS is performed per-cateogry ('class_idxs' must not be None.)

    Returns
    -------
    keep: Tensor
        1D integer vector that contains filtered indices to 'boxes3d' to keep after NMS.
    
tridet/layers/bev_nms.py