{"record":{"id":"3216e5b8609e23e0","repo":"roboflow/supervision","slug":"oriented-bounding-boxes-requested-but-oriented-b","errorCode":null,"errorMessage":"ORIENTED_BOUNDING_BOXES requested, but {ORIENTED_BOX_COORDINATES} is missing from detections.data","messagePattern":"ORIENTED_BOUNDING_BOXES requested, but (.+?) is missing from detections\\.data","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/supervision/metrics/detection.py","lineNumber":143,"sourceCode":"        ... )\n        >>> tensor_obb.shape\n        (1, 9)\n\n        ```\n    \"\"\"\n    _assert_supported_target(metric_target)\n\n    if detections.class_id is None:\n        raise ValueError(\n            \"ConfusionMatrix can only be calculated for Detections with class_id\"\n        )\n\n    box_data: npt.NDArray[np.float32]\n    if metric_target == MetricTarget.ORIENTED_BOUNDING_BOXES:\n        obb = detections.data.get(ORIENTED_BOX_COORDINATES)\n        if obb is None:\n            if len(detections) > 0:\n                raise ValueError(\n                    \"ORIENTED_BOUNDING_BOXES requested, but \"\n                    f\"{ORIENTED_BOX_COORDINATES} is missing from detections.data\"\n                )\n            box_data = np.empty((0, 8), dtype=np.float32)\n        else:\n            obb_arr = np.asarray(obb, dtype=np.float32)\n            # Normalize (N, 4, 2) → (N, 8) as produced by from_ultralytics.\n            if obb_arr.ndim == 3 and obb_arr.shape[1:] == (4, 2):\n                obb_arr = obb_arr.reshape(-1, 8)\n            if obb_arr.size != len(detections) * 8:\n                raise ValueError(\n                    f\"Expected {ORIENTED_BOX_COORDINATES} to contain \"\n                    f\"{len(detections) * 8} elements \"\n                    f\"(N={len(detections)} detections x 8 coordinates), \"\n                    f\"but got {obb_arr.size}. \"\n                    \"Each OBB must be stored as [x1, y1, x2, y2, x3, y3, x4, y4].\"\n                )\n            box_data = obb_arr.reshape(-1, 8)","sourceCodeStart":125,"sourceCodeEnd":161,"githubUrl":"https://github.com/roboflow/supervision/blob/7f254d9784d4c37e0f03cd89ddee164c8db099c0/src/supervision/metrics/detection.py#L125-L161","documentation":"Error \"ORIENTED_BOUNDING_BOXES requested, but {ORIENTED_BOX_COORDINATES} is missing from detections.data\" thrown in roboflow/supervision.","triggerScenarios":"Thrown at src/supervision/metrics/detection.py:143 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add ORIENTED_BOX_COORDINATES to detections.data with shape (N, 4, 2) before evaluating with MetricTarget.ORIENTED_BOUNDING_BOXES.","Load the dataset with is_obb=True or populate the OBB data manually."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7f254d9784d4c37e0f03cd89ddee164c8db099c0","analyzedAt":"2026-08-15T05:13:01.950Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}