@@ -43,6 +43,7 @@ def box_cxcywh_to_xyxy(x: "torch.Tensor"):
4343 """
4444 From DETR source: https://github.com/facebookresearch/detr
4545 (detr/util/box_ops.py)
46+ License: Apache 2.0
4647 """
4748 import torch
4849
@@ -55,6 +56,7 @@ def box_xyxy_to_cxcywh(x: "torch.Tensor"):
5556 """
5657 From DETR source: https://github.com/facebookresearch/detr
5758 (detr/util/box_ops.py)
59+ License: Apache 2.0
5860 """
5961 import torch
6062
@@ -67,6 +69,7 @@ def rescale_bboxes(out_bbox: "torch.Tensor", size: Tuple[int, int]):
6769 """
6870 From DETR source: https://github.com/facebookresearch/detr
6971 (inference notebook)
72+ License: Apache 2.0
7073 """
7174 import torch
7275
@@ -78,8 +81,9 @@ def rescale_bboxes(out_bbox: "torch.Tensor", size: Tuple[int, int]):
7881
7982def revert_rescale_bboxes (out_bbox : "torch.Tensor" , size : Tuple [int , int ]):
8083 """
81- Adapted rom DETR source: https://github.com/facebookresearch/detr
84+ Adapted from DETR source: https://github.com/facebookresearch/detr
8285 (inference notebook)
86+ License: Apache 2.0
8387 This method reverts bounding box rescaling to match input image size
8488 """
8589 import torch
@@ -94,6 +98,7 @@ def box_iou(boxes1: "torch.Tensor", boxes2: "torch.Tensor"):
9498 """
9599 From DETR source: https://github.com/facebookresearch/detr
96100 (detr/util/box_ops.py)
101+ License: Apache 2.0
97102 """
98103 import torch
99104 from torchvision .ops .boxes import box_area
@@ -117,6 +122,7 @@ def generalized_box_iou(boxes1: "torch.Tensor", boxes2: "torch.Tensor"):
117122 """
118123 From DETR source: https://github.com/facebookresearch/detr
119124 (detr/util/box_ops.py)
125+ License: Apache 2.0
120126 """
121127 import torch
122128
@@ -189,6 +195,7 @@ class HungarianMatcher(torch.nn.Module):
189195 """
190196 From DETR source: https://github.com/facebookresearch/detr
191197 (detr/models/matcher.py)
198+ License: Apache 2.0
192199 """
193200
194201 def __init__ (self , cost_class : float = 1 , cost_bbox : float = 1 , cost_giou : float = 1 ):
@@ -266,6 +273,7 @@ class SetCriterion(torch.nn.Module):
266273 """
267274 From DETR source: https://github.com/facebookresearch/detr
268275 (detr/models/detr.py)
276+ License: Apache 2.0
269277 """
270278
271279 def __init__ (self , num_classes , matcher , weight_dict , eos_coef , losses ):
@@ -981,6 +989,7 @@ def grad_enabled_forward(self, samples: NestedTensor):
981989 """
982990 Adapted from DETR source: https://github.com/facebookresearch/detr
983991 (detr/models/detr.py)
992+ License: Apache 2.0
984993 """
985994 import torch
986995
0 commit comments