roboflow/supervision · error · ValueError

Unsupported metric target for IoU calculation

Error message

Unsupported metric target for IoU calculation

What it means

Error "Unsupported metric target for IoU calculation" thrown in roboflow/supervision.

Source

Thrown at src/supervision/metrics/precision.py:258

                            "Precision metric requires `confidence` on predictions."
                        )
                    prediction_class_ids = np.asarray(
                        predictions.class_id, dtype=np.int32
                    )
                    target_class_ids = np.asarray(targets.class_id, dtype=np.int32)
                    prediction_confidence = np.asarray(
                        predictions.confidence, dtype=np.float32
                    )
                    if self._metric_target == MetricTarget.BOXES:
                        iou = box_iou_batch(target_contents, prediction_contents)
                    elif self._metric_target == MetricTarget.MASKS:
                        iou = mask_iou_batch(target_contents, prediction_contents)
                    elif self._metric_target == MetricTarget.ORIENTED_BOUNDING_BOXES:
                        iou = oriented_box_iou_batch(
                            target_contents, prediction_contents
                        )
                    else:
                        raise ValueError(
                            "Unsupported metric target for IoU calculation"
                        )

                    # None keeps the matcher on its single-round fast path
                    # when no size bucket is scored.
                    target_scored_mask = (
                        target_size_mask
                        if size_category != ObjectSizeCategory.ANY
                        else None
                    )
                    matches, matched_target_indices = (
                        _match_detection_batch_with_target_indices(
                            prediction_class_ids,
                            target_class_ids,
                            iou,
                            iou_thresholds,
                            target_scored_mask=target_scored_mask,
                        )

View on GitHub (pinned to 7f254d9784)

Solutions

  1. Use a supported MetricTarget for IoU computation (e.g. BOXES).
  2. For unsupported targets, compute IoU with box-based metrics instead.

When it happens

Trigger: Thrown at src/supervision/metrics/precision.py:258 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/4b1ea50b269b881e. Report an issue: GitHub.