Skip to content

Commit 107d2cd

Browse files
authored
Fix f-string boxes.py
1 parent c509b11 commit 107d2cd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

torchvision/ops/boxes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ def _box_inter_union(boxes1: Tensor, boxes2: Tensor, fmt: str = "xyxy") -> tuple
315315
"cxcywh",
316316
)
317317
if fmt not in allowed_fmts:
318-
raise ValueError(f"Unsupported Box IoU Calculation for given fmt {format}.")
318+
raise ValueError(f"Unsupported Box IoU Calculation for given fmt {fmt}.")
319319

320320
if fmt == "xyxy":
321321
lt = torch.max(boxes1[..., None, :2], boxes2[..., None, :, :2]) # [...,N,M,2]
@@ -364,7 +364,7 @@ def box_iou(boxes1: Tensor, boxes2: Tensor, fmt: str = "xyxy") -> Tensor:
364364
"cxcywh",
365365
)
366366
if fmt not in allowed_fmts:
367-
raise ValueError(f"Unsupported Box IoU Calculation for given fmt {format}.")
367+
raise ValueError(f"Unsupported Box IoU Calculation for given fmt {fmt}.")
368368
inter, union = _box_inter_union(boxes1, boxes2, fmt=fmt)
369369
iou = inter / union
370370
return iou

0 commit comments

Comments
 (0)