This is an IoU metric that replaces DIoU using standardized distance.
There are two problems when using DIoU[1]: Position, Scale. Those are caused by a normalization factor affected by the center point distance of bounding boxes. So we implemented Standardized Distance-based IoU metric using different normalization factors(SDIoU).
DIoU based on
For easy understanding, the figure below shows each elements of the equation.
Following the equation based on
The standardized distance[2] uses the variance of each axis as a normalization factor. And we replaced the variance value with the equation for the height and width of two bounding boxes as follows:
The values of
And SDIoU(Standardized Distance-based IoU) solved all the problems of DIoU: Position, Scale.
- run the command
$ pip install -r requirements.txt
- initialize variables and add the code in your Loss function like below.
from sidou import *
...
pred = ... # prediction bounding box ((x, y, w, h), n)
gt = ... # prediction bounding box (n, (x, y, w, h))
iou = bbox_iou(pred, gt, SDIoU=True, std_type='mean')
...
- Zhaohui et al, Distance-IoU Loss: Faster and Better Learning for Bounding Box Regression, https://arxiv.org/abs/1911.08287
- Wikipedia, Distance, https://en.wikipedia.org/wiki/Distance