コード例 #1
0
ファイル: model.py プロジェクト: thegaussians/ObjectDetNet
def nms(dets, thresh):
    "Dispatch to either CPU or GPU NMS implementations.\
    Accept dets as tensor"""
    # return pth_nms(dets, thresh)
    if torch.cuda.is_available():
        return gpu_nms(dets, thresh)
    else:
        #TODO: make sure this is implemented correctly
        return cpu_nms(dets, thresh)
コード例 #2
0
ファイル: nms_wrapper.py プロジェクト: UpCoder/MyFasterRCNN
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=cfg.GPU_ID)
    else:
        return cpu_nms(dets, thresh)
コード例 #3
0
 def _nms(dets):
     return cpu_nms(dets, thresh)