/// Run Non-Maximum Suppression algorithm on boxes with corresponding scores.
///
/// - **dets** - Nx4 shaped float tensor in left-top-right-bottom format.
/// - **scores** - N shaped float tensor of scores for each box.
/// - **iou_threshold** - The IoU threshold value if one box is considered overlapped with the other.
Run Non-Maximum Suppression algorithm on boxes with corresponding scores.
dets** - Nx4 shaped float tensor in left-top-right-bottom format.
scores** - N shaped float tensor of scores for each box.
iou_threshold** - The IoU threshold value if one box is considered overlapped with the other.
Run Non - Maximum Suppression algorithm on boxes with corresponding scores . dets ** - Nx4 shaped float tensor in left - top - right - bottom format . scores ** - N shaped float tensor of scores for each box . iou_threshold ** - The IoU threshold value if one box is considered overlapped with the other .
pub fn nms_by_scores(
    dets: &Tensor,
    scores: &Tensor,
    groups: &Tensor,
    iou_threshold: f64,
) -> Result<Tensor, TchError> {
    match (dets.device(), scores.device(), groups.device()) {
        (Device::Cpu, Device::Cpu, Device::Cpu) => {
            nms_by_scores_cpu(dets, scores, groups, iou_threshold)
        }
        (Device::Cuda(_), Device::Cuda(_), Device::Cuda(_)) => {
            nms_by_scores_cuda(dets, scores, groups, iou_threshold)
        }
        _ => Err(TchError::Torch(
            "dets, scores and groups tensors must be on identical device".to_string(),
        )),
    }
}
pub fn nms_by_scores ( dets : & Tensor , scores : & Tensor , groups : & Tensor , iou_threshold : f64 , ) -> Result < Tensor , TchError > { match ( dets . device ( ) , scores . device ( ) , groups . device ( ) ) { ( Device :: Cpu , Device :: Cpu , Device :: Cpu ) => { nms_by_scores_cpu ( dets , scores , groups , iou_threshold ) } ( Device :: Cuda ( _ ) , Device :: Cuda ( _ ) , Device :: Cuda ( _ ) ) => { nms_by_scores_cuda ( dets , scores , groups , iou_threshold ) } _ => Err ( TchError :: Torch ( " " . to_string ( ) , ) ) , } }
Run Non-Maximum Suppression algorithm on boxes with corresponding scores.
Run Non - Maximum Suppression algorithm on boxes with corresponding scores .
dets
&Tensor
scores
&Tensor
groups
&Tensor
iou_threshold
f64