Skip to content

Commit 1db8795

Browse files
authored
Remove assertions for generalized_box_iou (#5691)
1 parent b031e91 commit 1db8795

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

torchvision/ops/boxes.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -298,12 +298,6 @@ def generalized_box_iou(boxes1: Tensor, boxes2: Tensor) -> Tensor:
298298
"""
299299
if not torch.jit.is_scripting() and not torch.jit.is_tracing():
300300
_log_api_usage_once(generalized_box_iou)
301-
# degenerate boxes gives inf / nan results
302-
# so do an early check
303-
if (boxes1[:, 2:] < boxes1[:, :2]).any():
304-
raise ValueError("Some of the input boxes1 are invalid.")
305-
if not (boxes2[:, 2:] >= boxes2[:, :2]).all():
306-
raise ValueError("Some of the input boxes2 are invalid.")
307301

308302
inter, union = _box_inter_union(boxes1, boxes2)
309303
iou = inter / union

0 commit comments

Comments
 (0)