示例#1
0
def nms_wr(dets, thresh, force_cpu=False):
    """Dispatch to either CPU or GPU NMS implementations."""

    if dets.shape[0] == 0:
        return []
    if force_cpu:
        return cpu_soft_nms(dets, thresh, method=1)
        # return cpu_nms(dets, thresh)
    # return gpu_nms(dets, thresh)
    return cpu_soft_nms(dets, thresh, method=1)
示例#2
0
def soft_nms(dets, sigma=0.5, Nt=0.3, threshold=0.001, method=1):

    keep = cpu_soft_nms(np.ascontiguousarray(dets, dtype=np.float32),
                        np.float32(sigma), np.float32(Nt),
                        np.float32(threshold),
                        np.uint8(method))
    return keep
def soft_nms(dets, sigma=0.5, Nt=0.3, threshold=0.001, method=1):

    keep = cpu_soft_nms(np.ascontiguousarray(dets, dtype=np.float32),
                        np.float32(sigma), np.float32(Nt),
                        np.float32(threshold),
                        np.uint8(method))
    return keep
示例#4
0
def nms(dets, thresh, force_cpu=False):
    """Dispatch to either CPU or GPU NMS implementations."""

    if dets.shape[0] == 0:
        return []
    if cfg.USE_GPU_NMS and not force_cpu:
        return gpu_nms(dets, thresh, device_id=0)
    else:
        if cfg.USE_SOFT_NMS:
            return cpu_soft_nms(dets, thresh)
        return cpu_nms(dets, thresh)
示例#5
0
def soft_nms(dets, sigma=0.5, Nt=0.3, threshold=0.001, method=1):
    """
    Doing Soft-NMS.
    Check https://github.com/bharatsingh430/soft-nms for details.

    Parameters
    ----------
        dets:
        sigma:
        Nt:
        threshold:
        method: 1 for linear, 2 for gaussian and others for original NMS

    Returns
    -------
    """

    keep = cpu_soft_nms(np.ascontiguousarray(dets, dtype=np.float32),
                        np.float32(sigma), np.float32(Nt),
                        np.float32(threshold), np.uint8(method))
    return keep