Skip to content

Commit

Permalink
type ignore
Browse files Browse the repository at this point in the history
  • Loading branch information
Borda committed Oct 29, 2024
1 parent 301a9e9 commit 2c2993c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/torchmetrics/detection/iou.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def update(self, preds: List[Dict[str, Tensor]], target: List[Dict[str, Tensor]]
if det_boxes.numel() > 0 and gt_boxes.numel() > 0:
label_eq = p_i["labels"].unsqueeze(1) == t_i["labels"].unsqueeze(0) # N x M
else:
label_eq = torch.eye(iou_matrix.shape[0], dtype=bool, device=iou_matrix.device)
label_eq = torch.eye(iou_matrix.shape[0], dtype=bool, device=iou_matrix.device) # type: ignore[call-overload]
iou_matrix[~label_eq] = self._invalid_val
self.iou_matrix.append(iou_matrix)

Expand Down

0 comments on commit 2c2993c

Please sign in to comment.