@@ -25,7 +25,6 @@ class NestedTensor:
2525 """
2626 From DETR source: https://github.com/facebookresearch/detr
2727 (detr/util/misc.py)
28- License: Apache 2.0
2928 """
3029
3130 def __init__ (self , tensors , mask : Optional ["torch.Tensor" ]):
@@ -59,7 +58,6 @@ class HungarianMatcher(torch.nn.Module):
5958 """
6059 From DETR source: https://github.com/facebookresearch/detr
6160 (detr/models/matcher.py)
62- License: Apache 2.0
6361 """
6462
6563 def __init__ (self , cost_class : float = 1 , cost_bbox : float = 1 , cost_giou : float = 1 ):
@@ -135,7 +133,6 @@ class SetCriterion(torch.nn.Module):
135133 """
136134 From DETR source: https://github.com/facebookresearch/detr
137135 (detr/models/detr.py)
138- License: Apache 2.0
139136 """
140137
141138 def __init__ (self , num_classes , matcher , weight_dict , eos_coef , losses ):
@@ -343,7 +340,6 @@ def box_cxcywh_to_xyxy(x: "torch.Tensor"):
343340 """
344341 From DETR source: https://github.com/facebookresearch/detr
345342 (detr/util/box_ops.py)
346- License: Apache 2.0
347343 """
348344
349345 x_c , y_c , width , height = x .unbind (1 )
@@ -355,7 +351,6 @@ def box_xyxy_to_cxcywh(x: "torch.Tensor"):
355351 """
356352 From DETR source: https://github.com/facebookresearch/detr
357353 (detr/util/box_ops.py)
358- License: Apache 2.0
359354 """
360355
361356 x_0 , y_0 , x_1 , y_1 = x .unbind (- 1 )
@@ -367,7 +362,6 @@ def rescale_bboxes(out_bbox: "torch.Tensor", size: Tuple[int, int]):
367362 """
368363 From DETR source: https://github.com/facebookresearch/detr
369364 (inference notebook)
370- License: Apache 2.0
371365 """
372366
373367 img_w , img_h = size
@@ -380,7 +374,7 @@ def revert_rescale_bboxes(out_bbox: "torch.Tensor", size: Tuple[int, int]):
380374 """
381375 Adapted from DETR source: https://github.com/facebookresearch/detr
382376 (inference notebook)
383- License: Apache 2.0
377+
384378 This method reverts bounding box rescaling to match input image size
385379 """
386380
@@ -394,7 +388,6 @@ def box_iou(boxes1: "torch.Tensor", boxes2: "torch.Tensor"):
394388 """
395389 From DETR source: https://github.com/facebookresearch/detr
396390 (detr/util/box_ops.py)
397- License: Apache 2.0
398391 """
399392 from torchvision .ops .boxes import box_area
400393
@@ -417,7 +410,6 @@ def generalized_box_iou(boxes1: "torch.Tensor", boxes2: "torch.Tensor"):
417410 """
418411 From DETR source: https://github.com/facebookresearch/detr
419412 (detr/util/box_ops.py)
420- License: Apache 2.0
421413 """
422414
423415 assert (boxes1 [:, 2 :] >= boxes1 [:, :2 ]).all ()
@@ -437,7 +429,6 @@ def nested_tensor_from_tensor_list(tensor_list: Union[List, "torch.Tensor"]):
437429 """
438430 From DETR source: https://github.com/facebookresearch/detr
439431 (detr/util/misc.py)
440- License: Apache 2.0
441432 """
442433
443434 if tensor_list [0 ].ndim == 3 :
@@ -463,7 +454,6 @@ def grad_enabled_forward(self, samples: NestedTensor):
463454 """
464455 Adapted from DETR source: https://github.com/facebookresearch/detr
465456 (detr/models/detr.py)
466- License: Apache 2.0
467457 """
468458
469459 if isinstance (samples , (list , torch .Tensor )):
0 commit comments