def METHOD_NAME(self, boxes=None, scores=None, threshold=0.2, img=None):
    if isinstance(boxes, np.ndarray):
        boxes = torch.tensor(boxes, device=self.device)
    elif torch.is_tensor(boxes):
        if self.device == 'cpu':
            boxes = boxes.cpu()
        elif self.device == 'cuda':
            boxes = boxes.cuda()
    if isinstance(scores, np.ndarray):
        scores = torch.tensor(scores, device=self.device)
    elif torch.is_tensor(scores):
        if self.device == 'cpu':
            scores = scores.cpu()
        elif self.device == 'cuda':
            scores = scores.cuda()
    scores, classes = scores.max(dim=1)
    _, idx = scores.sort(0, descending=True)
    idx = idx[:self.top_k]
    boxes = boxes[idx]
    scores = scores[idx]
    classes = classes[idx]
    dets = torch.cat((boxes, scores.unsqueeze(-1)), dim=1)
    i = 0
    while dets.shape[0] > 0:
        scores[i] = dets[0, 4]
        iou = jaccard(dets[:1, :-1], dets[1:, :-1]).triu_(diagonal=0).squeeze(0)
        weight = torch.ones_like(iou)
        if self.nms_type == 'linear':
            weight[iou > self.nms_thres] -= iou[iou > self.nms_thres]
        elif self.nms_type == 'gaussian':
            weight = np.exp(-(iou * iou) / self.nms_thres)
        dets[1:, 4] *= weight
        dets = dets[1:, :]
        i = i + 1
    keep_ids = torch.where(scores > threshold)
    scores = scores[keep_ids].cpu().numpy()
    classes = classes[keep_ids].cpu().numpy()
    boxes = boxes[keep_ids].cpu().numpy()
    bounding_boxes = BoundingBoxList([])
    for idx, box in enumerate(boxes):
        bbox = BoundingBox(left=box[0], top=box[1],
                           width=box[2] - box[0],
                           height=box[3] - box[1],
                           name=classes[idx],
                           score=scores[idx])
        bounding_boxes.data.append(bbox)
    return bounding_boxes, [boxes, classes, scores]