@@ -11,8 +11,6 @@ def giou_loss(
11
11
Original implementation from
12
12
https://github.com/facebookresearch/fvcore/blob/bfff2ef/fvcore/nn/giou_loss.py
13
13
14
- Generalized Intersection over Union Loss (Hamid Rezatofighi et. al)
15
- https://arxiv.org/abs/1902.09630
16
14
Gradient-friendly IoU loss with an additional penalty that is non-zero when the
17
15
boxes do not overlap and scales with the size of their smallest enclosing box.
18
16
This loss is symmetric, so the boxes1 and boxes2 arguments are interchangeable.
@@ -24,11 +22,16 @@ def giou_loss(
24
22
Args:
25
23
boxes1 (Tensor[N, 4] or Tensor[4]): first set of boxes
26
24
boxes2 (Tensor[N, 4] or Tensor[4]): second set of boxes
27
- reduction (str): 'none' | 'mean' | 'sum'
28
- 'none': No reduction will be applied to the output.
29
- 'mean': The output will be averaged.
30
- 'sum': The output will be summed.
31
- eps (float): small number to prevent division by zero
25
+ reduction (string, optional): Specifies the reduction to apply to the output:
26
+ ``'none'`` | ``'mean'`` | ``'sum'``. ``'none'``: No reduction will be
27
+ applied to the output. ``'mean'``: The output will be averaged.
28
+ ``'sum'``: The output will be summed. Default: ``'none'``
29
+ eps (float, optional): small number to prevent division by zero. Default: 1e-7
30
+
31
+ Reference:
32
+ Hamid Rezatofighi et. al: Generalized Intersection over Union:
33
+ A Metric and A Loss for Bounding Box Regression:
34
+ https://arxiv.org/abs/1902.09630
32
35
"""
33
36
34
37
x1 , y1 , x2 , y2 = boxes1 .unbind (dim = - 1 )
0 commit comments