Team Ai
Apppublic

Arulkumar03/Fox_Sheep_Detector_Computer_Vision_model

sourceHugging Facemitupdated 3y agoView on Hugging Face
0likes
rotated_boxes.py22 linesDownload Raw Back to layers
1# Copyright (c) Facebook, Inc. and its affiliates.2from __future__ import absolute_import, division, print_function, unicode_literals3import torch4 5 6def pairwise_iou_rotated(boxes1, boxes2):7    """8    Return intersection-over-union (Jaccard index) of boxes.9 10    Both sets of boxes are expected to be in11    (x_center, y_center, width, height, angle) format.12 13    Arguments:14        boxes1 (Tensor[N, 5])15        boxes2 (Tensor[M, 5])16 17    Returns:18        iou (Tensor[N, M]): the NxM matrix containing the pairwise19            IoU values for every element in boxes1 and boxes220    """21    return torch.ops.detectron2.box_iou_rotated(boxes1, boxes2)22