dgs.models.metric.metric.IOUDistance.forward

IOUDistance.forward(input1: torch.Tensor, input2: torch.Tensor) torch.Tensor[source]

Compute the intersection-over-union between two input tensors.

The inputs should be tv_tensors.BoundingBoxes. This function will transform given bounding boxes to ‘XYXY’ if they have a different format.

Parameters:
  • input1 – bbox of shape [a x 4]

  • input2 – bbox of shape [b x 4]

Returns:

A tensor of shape [a x b] containing the distances between the inputs.

Raises:

TypeError – If input1 or input2 is not a tv_tensors.BoundingBoxes object.