{"record":{"id":"d992adb74a7abba7","repo":"roboflow/supervision","slug":"expected-result-with-a-single-element-got-resul","errorCode":null,"errorMessage":"Expected result with a single element. Got: {result}","messagePattern":"Expected result with a single element\\. Got: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/supervision/detection/vlm.py","lineNumber":538,"sourceCode":"\n    Args:\n        result: dict containing the model output\n        resolution_wh: (output_width, output_height) to which we rescale the boxes.\n\n    Returns:\n        A tuple of `(xyxy, labels, masks, obb_boxes)` where `xyxy` is an array\n            of shape `(n, 4)` in format `[x1, y1, x2, y2]`, `labels` is an\n            optional array of shape `(n,)` with class labels, `masks` is an\n            optional array of shape `(n, h, w)` with segmentation masks, and\n            `obb_boxes` is an optional array of shape `(n, 4, 2)` with oriented\n            bounding boxes.\n\n    Raises:\n        ValueError: If the top-level Florence 2 payload has multiple tasks or\n            if a task payload is malformed.\n    \"\"\"\n    if len(result) != 1:\n        raise ValueError(f\"Expected result with a single element. Got: {result}\")\n    task = next(iter(result.keys()))\n    if task not in SUPPORTED_TASKS_FLORENCE_2:\n        raise ValueError(\n            f\"{task} not supported. Supported tasks are: {SUPPORTED_TASKS_FLORENCE_2}\"\n        )\n    result = result[task]\n\n    if task in [\"<OD>\", \"<CAPTION_TO_PHRASE_GROUNDING>\", \"<DENSE_REGION_CAPTION>\"]:\n        xyxy = np.array(result[\"bboxes\"], dtype=np.float32)\n        labels = np.array(result[\"labels\"])\n        return xyxy, labels, None, None\n\n    if task == \"<REGION_PROPOSAL>\":\n        xyxy = np.array(result[\"bboxes\"], dtype=np.float32)\n        # provides labels, but they are [\"\", \"\", \"\", ...]\n        return xyxy, None, None, None\n\n    if task == \"<OCR_WITH_REGION>\":","sourceCodeStart":520,"sourceCodeEnd":556,"githubUrl":"https://github.com/roboflow/supervision/blob/7f254d9784d4c37e0f03cd89ddee164c8db099c0/src/supervision/detection/vlm.py#L520-L556","documentation":"Error \"Expected result with a single element. Got: {result}\" thrown in roboflow/supervision.","triggerScenarios":"Thrown at src/supervision/detection/vlm.py:538 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a result containing exactly one element; index into batched model output first, e.g. result[0].","If you batch inference, loop over the results and call the connector once per single result."],"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"}