roboflow/supervision · error · ValueError

Both dimensions in resolution_wh must be positive. Got ({w},

Error message

Both dimensions in resolution_wh must be positive. Got ({w}, {h}).

What it means

Error "Both dimensions in resolution_wh must be positive. Got ({w}, {h})." thrown in roboflow/supervision.

Source

Thrown at src/supervision/detection/vlm.py:969

      {
          "objects": [
              {"x_min": 0.1, "y_min": 0.2, "x_max": 0.3, "y_max": 0.4},
              {"x_min": 0.5, "y_min": 0.6, "x_max": 0.7, "y_max": 0.8}
          ]
      }

    Args:
        result: Dictionary containing the JSON output from the model.
        resolution_wh: (output_width, output_height) to which we rescale the boxes.

    Returns:
        An array of shape `(n, 4)` containing the bounding boxes coordinates
            in format `[x1, y1, x2, y2]`.
    """

    w, h = resolution_wh
    if w <= 0 or h <= 0:
        raise ValueError(
            f"Both dimensions in resolution_wh must be positive. Got ({w}, {h})."
        )

    if "objects" not in result or not isinstance(result["objects"], list):
        return np.empty((0, 4), dtype=float)

    xyxy = []

    for item in result["objects"]:
        if not all(k in item for k in ["x_min", "y_min", "x_max", "y_max"]):
            continue

        x_min = item["x_min"]
        y_min = item["y_min"]
        x_max = item["x_max"]
        y_max = item["y_max"]

        xyxy.append([x_min, y_min, x_max, y_max])

View on GitHub (pinned to 7f254d9784)

Solutions

  1. Pass a resolution_wh tuple of two positive integers, e.g. (width, height) from image.shape[1], image.shape[0].
  2. Check that the image was loaded correctly and its dimensions are non-zero before calling.

When it happens

Trigger: Thrown at src/supervision/detection/vlm.py:969 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/701510fa184f767b. Report an issue: GitHub.