{"record":{"id":"701510fa184f767b","repo":"roboflow/supervision","slug":"both-dimensions-in-resolution-wh-must-be-positive","errorCode":null,"errorMessage":"Both dimensions in resolution_wh must be positive. Got ({w}, {h}).","messagePattern":"Both dimensions in resolution_wh must be positive\\. Got \\((.+?), (.+?)\\)\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/supervision/detection/vlm.py","lineNumber":969,"sourceCode":"      {\n          \"objects\": [\n              {\"x_min\": 0.1, \"y_min\": 0.2, \"x_max\": 0.3, \"y_max\": 0.4},\n              {\"x_min\": 0.5, \"y_min\": 0.6, \"x_max\": 0.7, \"y_max\": 0.8}\n          ]\n      }\n\n    Args:\n        result: Dictionary containing the JSON output from the model.\n        resolution_wh: (output_width, output_height) to which we rescale the boxes.\n\n    Returns:\n        An array of shape `(n, 4)` containing the bounding boxes coordinates\n            in format `[x1, y1, x2, y2]`.\n    \"\"\"\n\n    w, h = resolution_wh\n    if w <= 0 or h <= 0:\n        raise ValueError(\n            f\"Both dimensions in resolution_wh must be positive. Got ({w}, {h}).\"\n        )\n\n    if \"objects\" not in result or not isinstance(result[\"objects\"], list):\n        return np.empty((0, 4), dtype=float)\n\n    xyxy = []\n\n    for item in result[\"objects\"]:\n        if not all(k in item for k in [\"x_min\", \"y_min\", \"x_max\", \"y_max\"]):\n            continue\n\n        x_min = item[\"x_min\"]\n        y_min = item[\"y_min\"]\n        x_max = item[\"x_max\"]\n        y_max = item[\"y_max\"]\n\n        xyxy.append([x_min, y_min, x_max, y_max])","sourceCodeStart":951,"sourceCodeEnd":987,"githubUrl":"https://github.com/roboflow/supervision/blob/7f254d9784d4c37e0f03cd89ddee164c8db099c0/src/supervision/detection/vlm.py#L951-L987","documentation":"Error \"Both dimensions in resolution_wh must be positive. Got ({w}, {h}).\" thrown in roboflow/supervision.","triggerScenarios":"Thrown at src/supervision/detection/vlm.py:969 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a resolution_wh tuple of two positive integers, e.g. (width, height) from image.shape[1], image.shape[0].","Check that the image was loaded correctly and its dimensions are non-zero before calling."],"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-15T22:17:37.221Z"}