code: def test_on_image(
      self, static_image_mode, model_complexity, num_frames
  ):
      image_path = os.path.join(
          os.path.dirname(__file__), "testdata/pose.jpg"
      )
      expected_segmentation_path = os.path.join(
          os.path.dirname(__file__), "testdata/pose_segmentation.png"
      )
      image = cv2.imread(image_path)
      expected_segmentation = self._rgb_to_segmentation(
          Image.open(expected_segmentation_path).convert("RGB")
      )
  
      with mp_pose.Pose(
          static_image_mode=static_image_mode,
          model_complexity=model_complexity,
          enable_segmentation=True,
      ) as pose:
          for idx in range(num_frames):
              results = pose.process(
                  cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
              )
              segmentation = results.segmentation_mask.round().astype(
                  np.uint8
              )
  
              # TODO: Add rendering of world 3D when supported.
              self._annotate(image.copy(), results, idx)
              self._annotate_segmentation(
                  segmentation, expected_segmentation, idx
              )
  
              self._assert_diff_less(
                  self._landmarks_list_to_array(
                      results.pose_landmarks, image.shape
                  )[:, :2],
                  EXPECTED_POSE_LANDMARKS,
                  DIFF_THRESHOLD,
              )
              self._assert_diff_less(
                  self._world_landmarks_list_to_array(
                      results.pose_world_landmarks
                  ),
                  EXPECTED_POSE_WORLD_LANDMARKS,
                  WORLD_DIFF_THRESHOLD,
              )
              self.assertGreaterEqual(
                  self._segmentation_iou(
                      expected_segmentation, segmentation
                  ),
                  IOU_THRESHOLD,
              )
  
imports: import json
  import os
  import tempfile
  from typing import NamedTuple
  from absl.testing import absltest
  from absl.testing import parameterized
  import cv2
  import numpy
  import numpy.testing
  from PIL import Image
  from mediapipe.python.solutions import drawing_styles
  from mediapipe.python.solutions import drawing_utils
  from mediapipe.python.solutions import pose
label_desc: Use image node_id 13 for calling the PoseTest obj's underlying member method code with example usage: obj.test_on_image(static_image_mode, model_complexity, num_frames) without return types