roboflow/supervision · error · ValueError
MetricTarget.MASKS is not currently supported for…
Error message
MetricTarget.MASKS is not currently supported for ConfusionMatrix.
What it means
Error "MetricTarget.MASKS is not currently supported for ConfusionMatrix." thrown in roboflow/supervision.
Solutions
- ConfusionMatrix does not support MetricTarget.MASKS; use MetricTarget.BOXES or ORIENTED_BOUNDING_BOXES.
- To evaluate masks, use MeanAveragePrecision/MeanAverageRecall with MetricTarget.MASKS instead.
When it happens
Trigger: Thrown at src/supervision/metrics/detection.py:34 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of roboflow/supervision@7f254d9784 (2026-08-15).
Data as JSON: /api/errors/7bf3c78314fa2d6f.
Report an issue: GitHub.
Appendix: source
Thrown at src/supervision/metrics/detection.py:34
)
from supervision.config import ORIENTED_BOX_COORDINATES
from supervision.dataset.core import DetectionDataset
from supervision.detection.core import Detections
from supervision.detection.utils.iou_and_nms import (
box_iou_batch,
oriented_box_iou_batch,
)
from supervision.metrics.core import MetricTarget
from supervision.metrics.utils.matching import _greedy_match
if TYPE_CHECKING:
from matplotlib.figure import Figure
def _assert_supported_target(metric_target: MetricTarget) -> None:
if metric_target == MetricTarget.MASKS:
raise ValueError(
"MetricTarget.MASKS is not currently supported for ConfusionMatrix."
)
def _validated_class_ids(
values: npt.NDArray[np.float32],
num_classes: int,
role: str,
) -> npt.NDArray[np.int64]:
"""Return class ids that are safe to use as confusion-matrix indexes."""
if values.size == 0:
return np.asarray(values, dtype=np.int64)
finite = np.isfinite(values)
integral = values == np.floor(values)
if not np.all(finite & integral):
raise ValueError(f"{role} class ids must be finite integers.")
View on GitHub (pinned to 7f254d9784)