roboflow/supervision · error · ValueError

Unsupported MediaPipe result type. Expected an object with p

Error message

Unsupported MediaPipe result type. Expected an object with pose_landmarks, face_landmarks, or multi_face_landmarks.

What it means

Raised by KeyPoints.from_mediapipe() when the passed result object exposes none of the expected attributes: pose_landmarks, face_landmarks, or multi_face_landmarks. The connector duck-types MediaPipe outputs, so an object that does not look like a MediaPipe pose/face result cannot be parsed and is rejected with an explicit message rather than an AttributeError deeper in.

Source

Thrown at src/supervision/key_points/core.py:569

                    results = [
                        [
                            landmark
                            for landmark in mediapipe_results.pose_landmarks.landmark
                        ]
                    ]
        elif hasattr(mediapipe_results, "face_landmarks"):
            results = mediapipe_results.face_landmarks
        elif hasattr(mediapipe_results, "multi_face_landmarks"):
            if mediapipe_results.multi_face_landmarks is None:
                results = []
            else:
                results = [
                    face_landmark.landmark
                    for face_landmark in mediapipe_results.multi_face_landmarks
                ]
        else:
            # Reject unsupported MediaPipe-like payloads before landmark parsing.
            raise ValueError(
                "Unsupported MediaPipe result type. Expected an object with "
                "pose_landmarks, face_landmarks, or multi_face_landmarks."
            )

        if len(results) == 0:
            return cls.empty()

        xy = []
        confidence = []
        for pose in results:
            prediction_xy = []
            prediction_confidence = []
            for landmark in pose:
                keypoint_xy = [
                    landmark.x * resolution_wh[0],
                    landmark.y * resolution_wh[1],
                ]
                prediction_xy.append(keypoint_xy)

View on GitHub (pinned to 7f254d9784)

Solutions

  1. Pass the actual result object returned by process(), not a sub-field or a list: sv.KeyPoints.from_mediapipe(results.pose_landmarks and results) — from_mediapipe expects the container with pose_landmarks/face_landmarks attributes.
  2. If using the new MediaPipe Tasks API, extract result.pose_landmarks (a list of NormalizedLandmark lists) into an object exposing pose_landmarks, or convert manually.
  3. Verify with hasattr(result, 'pose_landmarks') before calling.

Example fix

// before
kp = sv.KeyPoints.from_mediapipe(result.landmarks)  # wrong object

// after
kp = sv.KeyPoints.from_mediapipe(result)  # object with pose_landmarks / face_landmarks attrs
Defensive patterns

Strategy: type-guard

Validate before calling

result_attrs = {"pose_landmarks", "face_landmarks", "multi_face_landmarks"}
if not (result_attrs & set(vars(result))):
    raise TypeError(f"Not a MediaPipe result: {type(result)}")
kp = sv.KeyPoints.from_mediapipe(result)

Type guard

def is_mediapipe_result(obj) -> bool:
    return any(
        hasattr(obj, a)
        for a in ("pose_landmarks", "face_landmarks", "multi_face_landmarks")
    )

Try / catch

try:
    kp = sv.KeyPoints.from_mediapipe(result)
except ValueError as e:
    if "Unsupported MediaPipe result type" in str(e):
        raise TypeError(f"Wrong MediaPipe payload: {type(result)}") from e
    raise

Prevention

When it happens

Trigger: Calling sv.KeyPoints.from_mediapipe(result) with the wrong MediaPipe task output — e.g. passing a MediaPipe Holistic result whose fields changed across versions, passing the raw SolutionOutputs wrapper vs the .pose_landmarks field, or passing a completely unrelated object.

Common situations: MediaPipe legacy Solutions vs new Tasks API objects having different attribute names; passing a list of NormalizedLandmark instead of the task result; version upgrades of mediapipe renaming fields.

Related errors


AI-assisted analysis of roboflow/supervision@7f254d9784 (2026-08-15). Data as JSON: /api/errors/57e9864b43253325. Report an issue: GitHub.