code: def test_face(self, model_selection):
      image_path = os.path.join(
          os.path.dirname(__file__), "testdata/portrait.jpg"
      )
      image = cv2.imread(image_path)
      rows, cols, _ = image.shape
      with mp_faces.FaceDetection(
          min_detection_confidence=0.5, model_selection=model_selection
      ) as faces:
          for idx in range(5):
              results = faces.process(
                  cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
              )
              self._annotate(image.copy(), results, idx)
              location_data = results.detections[0].location_data
              x = [
                  keypoint.x * cols
                  for keypoint in location_data.relative_keypoints
              ]
              y = [
                  keypoint.y * rows
                  for keypoint in location_data.relative_keypoints
              ]
              face_keypoints = np.column_stack((x, y))
              if model_selection == 0:
                  prediction_error = np.abs(
                      np.asarray(face_keypoints)
                      - np.asarray(SHORT_RANGE_EXPECTED_FACE_KEY_POINTS)
                  )
              else:
                  prediction_error = np.abs(
                      np.asarray(face_keypoints)
                      - np.asarray(FULL_RANGE_EXPECTED_FACE_KEY_POINTS)
                  )
  
              self.assertLen(results.detections, 1)
              self.assertLen(location_data.relative_keypoints, 6)
              npt.assert_array_less(prediction_error, DIFF_THRESHOLD)
  
file_path: mediapipe/mediapipe/python/solutions/face_detection_test.py
imports: 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 mediapipe.python.solutions import drawing_utils
  from mediapipe.python.solutions import face_detection
label_desc: Use image node_id 4 for calling the FaceDetectionTest obj's underlying member method code with example usage: obj.test_face(model_selection) without return types