code: def find_best_frame_func(self, source, driving):
      import face_alignment
  
      def normalize_kp(kp):
          kp = kp - kp.mean(axis=0, keepdims=True)
          area = ConvexHull(kp[:, :2]).volume
          area = np.sqrt(area)
          kp[:, :2] = kp[:, :2] / area
          return kp
  
      fa = face_alignment.FaceAlignment(
          face_alignment.LandmarksType._2D, flip_input=True
      )
  
      kp_source = fa.get_landmarks(255 * source)[0]
      kp_source = normalize_kp(kp_source)
      norm = float("inf")
      frame_num = 0
      for i, image in tqdm(enumerate(driving)):
          kp_driving = fa.get_landmarks(255 * image)[0]
          kp_driving = normalize_kp(kp_driving)
          new_norm = (np.abs(kp_source - kp_driving) ** 2).sum()
          if new_norm < norm:
              norm = new_norm
              frame_num = i
      return frame_num
  
imports: import os
  import sys
  import math
  import pickle
  import yaml
  import imageio
  import numpy
  from tqdm import tqdm
  from scipy.spatial import ConvexHull
  import cv2
  import paddle
  from ppgan.utils.download import get_path_from_url
  from ppgan.utils.animate import normalize_kp
  from ppgan.modules.keypoint_detector import KPDetector
  from ppgan.models.generators.occlusion_aware import OcclusionAwareGenerator
  from ppgan.faceutils import face_detection
label_desc: Use image node_id 6 for calling the FirstOrderPredictor obj's underlying member method code with example usage: obj.find_best_frame_func(source, driving) and returns: frame_num, kp