# --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
from fast_rcnn.config import cfg
if cfg.USE_GPU_NMS:
from nms.gpu_nms import gpu_nms
from nms.cpu_nms import cpu_nms
def nms(dets, thresh, force_cpu=False):
"""Dispatch to either CPU or GPU NMS implementations."""
if dets.shape[0] == 0:
return []
#查得:USE_GPU_NMS=TRUE,force_cpu=False
if cfg.USE_GPU_NMS and not force_cpu:
#就是通过nms算法对proposal进行进一步提纯,返回的是提纯后的order引索
return gpu_nms(dets, thresh, device_id=cfg.GPU_ID)
else:
return cpu_nms(dets, thresh)
Faster-RCNN_TF代码解读13:nms_wrapper.py
最新推荐文章于 2021-08-23 16:35:51 发布