e421e832883241bd7831bf77dc31d5fb31d7da58,mmdet/ops/nms/nms_wrapper.py,,nms,#Any#Any#Any#,9
Before Change
inds = (gpu_nms(dets_np, iou_thr, device_id=device_id)
if device_id is not None else cpu_nms(dets_np, iou_thr))
if is_tensor:
inds = dets.new_tensor(inds, dtype=torch.long)
else:
inds = np.array(inds, dtype=np.int64)
return dets[inds, :], inds
def soft_nms(dets, iou_thr, method="linear", sigma=0.5, min_score=1e-3):
After Change
elif isinstance(dets, np.ndarray):
is_numpy = True
device = "cpu" if device_id is None else "cuda:{}".format(device_id)
dets_th = torch.from_numpy(dets).to(device)
else:
raise TypeError(
"dets must be either a Tensor or numpy array, but got {}".format(
type(dets)))
// execute cpu or cuda nms
if dets_th.shape[0] == 0:
inds = dets_th.new_zeros(0, dtype=torch.long)
else:
if dets_th.is_cuda:
inds = nms_cuda.nms(dets_th, iou_thr)
else:
inds = nms_cpu.nms(dets_th, iou_thr)
if is_numpy:
inds = inds.cpu().numpy()
return dets[inds, :], inds
def soft_nms(dets, iou_thr, method="linear", sigma=0.5, min_score=1e-3):
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 6
Instances
Project Name: open-mmlab/mmdetection
Commit Name: e421e832883241bd7831bf77dc31d5fb31d7da58
Time: 2019-04-06
Author: chenkaidev@gmail.com
File Name: mmdet/ops/nms/nms_wrapper.py
Class Name:
Method Name: nms
Project Name: IBM/adversarial-robustness-toolbox
Commit Name: 9b9a42de05056b418f98e3635f2cffd747123548
Time: 2018-05-16
Author: M.N.Tran@ibm.com
File Name: art/classifiers/pytorch.py
Class Name: PyTorchClassifier
Method Name: class_gradient
Project Name: dpressel/mead-baseline
Commit Name: 2eb4c5f77bd8da9b1e23851b0acb84543e442953
Time: 2018-09-24
Author: dpressel@gmail.com
File Name: python/baseline/pytorch/classify/model.py
Class Name: WordClassifierModelBase
Method Name: make_input