当前位置: 首页>>代码示例>>Python>>正文


Python cython_nms.soft_nms方法代码示例

本文整理汇总了Python中utils.cython_nms.soft_nms方法的典型用法代码示例。如果您正苦于以下问题:Python cython_nms.soft_nms方法的具体用法?Python cython_nms.soft_nms怎么用?Python cython_nms.soft_nms使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在utils.cython_nms的用法示例。


在下文中一共展示了cython_nms.soft_nms方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: soft_nms

# 需要导入模块: from utils import cython_nms [as 别名]
# 或者: from utils.cython_nms import soft_nms [as 别名]
def soft_nms(
    dets, sigma=0.5, overlap_thresh=0.3, score_thresh=0.001, method='linear'
):
    """Apply the soft NMS algorithm from https://arxiv.org/abs/1704.04503."""
    if dets.shape[0] == 0:
        return dets, []

    methods = {'hard': 0, 'linear': 1, 'gaussian': 2}
    assert method in methods, 'Unknown soft_nms method: {}'.format(method)

    dets, keep = cython_nms.soft_nms(
        np.ascontiguousarray(dets, dtype=np.float32),
        np.float32(sigma),
        np.float32(overlap_thresh),
        np.float32(score_thresh),
        np.uint8(methods[method])
    )
    return dets, keep 
开发者ID:roytseng-tw,项目名称:Detectron.pytorch,代码行数:20,代码来源:boxes.py

示例2: soft_nms

# 需要导入模块: from utils import cython_nms [as 别名]
# 或者: from utils.cython_nms import soft_nms [as 别名]
def soft_nms(
    dets, sigma=0.5, overlap_thresh=0.3, score_thresh=0.001, method='linear'
):
    import utils.cython_nms as cython_nms

    """Apply the soft NMS algorithm from https://arxiv.org/abs/1704.04503."""
    if dets.shape[0] == 0:
        return dets, []

    methods = {'hard': 0, 'linear': 1, 'gaussian': 2}
    assert method in methods, 'Unknown soft_nms method: {}'.format(method)

    dets, keep = cython_nms.soft_nms(
        np.ascontiguousarray(dets, dtype=np.float32),
        np.float32(sigma),
        np.float32(overlap_thresh),
        np.float32(score_thresh),
        np.uint8(methods[method])
    )
    return dets, keep 
开发者ID:gangadhar-p,项目名称:NucleiDetectron,代码行数:22,代码来源:boxes.py

示例3: soft_nms

# 需要导入模块: from utils import cython_nms [as 别名]
# 或者: from utils.cython_nms import soft_nms [as 别名]
def soft_nms(
    dets, sigma=0.5, overlap_thresh=0.3, score_thresh=0.001, method='linear'
):
    if dets.shape[0] == 0:
        return dets
    if dets.shape[1] > 5:
        raise NotImplementedError('Need to handle tubes..')

    methods = {'hard': 0, 'linear': 1, 'gaussian': 2}
    assert method in methods, 'Unknown soft_nms method: {}'.format(method)

    dets = cpu_soft_nms(
        np.ascontiguousarray(dets, dtype=np.float32),
        np.float32(sigma),
        np.float32(overlap_thresh),
        np.float32(score_thresh),
        np.uint8(methods[method]))
    return dets 
开发者ID:facebookresearch,项目名称:DetectAndTrack,代码行数:20,代码来源:nms_wrapper.py


注:本文中的utils.cython_nms.soft_nms方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。