e421e832883241bd7831bf77dc31d5fb31d7da58,mmdet/ops/nms/nms_wrapper.py,,nms,#Any#Any#Any#,9
Before Change
is_tensor = True
if dets.is_cuda:
device_id = dets.get_device()
dets_np = dets.detach().cpu().numpy()
elif isinstance(dets, np.ndarray):
is_tensor = False
dets_np = dets
else:
raise TypeError(
"dets must be either a Tensor or numpy array, but got {}".format(
type(dets)))
if dets_np.shape[0] == 0:
inds = []
else:
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
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: 7
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: havakv/pycox
Commit Name: 190d9b204a1a4798f0723c8d8d37ac5ac950909e
Time: 2019-05-08
Author: haavard.kvamme@gmail..com
File Name: pycox/models/deephit.py
Class Name: DeepHitSingle
Method Name: predict_survival_function
Project Name: ray-project/ray
Commit Name: d9f1874e3489edc915228dcfdae64d5294034464
Time: 2020-10-27
Author: sven@anyscale.io
File Name: rllib/agents/pg/tests/test_pg.py
Class Name: TestPG
Method Name: test_pg_loss_functions