def filter_collisions(self, boxes, sample_boxes): N = boxes.shape[0] boxes = torch.cat(( torch.from_numpy(boxes), torch.from_numpy(sample_boxes), )).cuda().float()[:, [0, 1, 3, 4, 6]] iou = box_iou_rotated(boxes, boxes).cpu().numpy() mask = (iou > 1e-2).sum(1)[N:] == 1 return mask
def compute_iou(self, boxes, anchors): matrix = box_iou_rotated( boxes[:, [0, 1, 3, 4, 6]], anchors[:, [0, 1, 3, 4, 6]], ) return matrix