Shortcuts

distance_box_iou

torchvision.ops.distance_box_iou(boxes1: torch.Tensor, boxes2: torch.Tensor, eps: float = 1e-07)torch.Tensor[source]

Return distance intersection-over-union (Jaccard index) between two sets of boxes.

Both sets of boxes are expected to be in (x1, y1, x2, y2) format with 0 <= x1 < x2 and 0 <= y1 < y2.

Parameters
  • boxes1 (Tensor[N, 4]) – first set of boxes

  • boxes2 (Tensor[M, 4]) – second set of boxes

  • eps (float, optional) – small number to prevent division by zero. Default: 1e-7

Returns

the NxM matrix containing the pairwise distance IoU values for every element in boxes1 and boxes2

Return type

Tensor[N, M]

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources