dd2907ed70a9f29ecbe2fba75de735e96daae3a2,mmdet/ops/nms/nms_wrapper.py,,nms,#Any#Any#Any#,9

Before Change


        inds = (gpu_nms(dets, thresh, device_id=device_id)
                if device_id is not None else cpu_nms(dets, thresh))

    if tensor_device:
        return torch.Tensor(inds).long().to(tensor_device)
    else:
        return np.array(inds, dtype=np.int)


def soft_nms(dets, Nt=0.3, method=1, sigma=0.5, min_score=0):
    if isinstance(dets, torch.Tensor):
        _dets = dets.detach().cpu().numpy()
    else:

After Change


        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
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: open-mmlab/mmdetection
Commit Name: dd2907ed70a9f29ecbe2fba75de735e96daae3a2
Time: 2018-11-26
Author: chenkaidev@gmail.com
File Name: mmdet/ops/nms/nms_wrapper.py
Class Name:
Method Name: nms


Project Name: mariogeiger/se3cnn
Commit Name: fdefea94af715b82cf1c885e53da75dfa26f5b58
Time: 2019-08-14
Author: geiger.mario@gmail.com
File Name: se3cnn/SO3.py
Class Name:
Method Name: spherical_harmonics_xyz


Project Name: facebookresearch/ParlAI
Commit Name: 72d0f5a40c427d25f4204f18589f13aefb6a874e
Time: 2019-02-06
Author: samuel.humeau@gmail.com
File Name: parlai/agents/bert_ranker/bothencoder_ranker.py
Class Name: BothEncoderRankerAgent
Method Name: eval_step